we need to stop posting your homework/classwork

Pages: 1234
You are talking quotes and dividing them, which now has different meaning since you put it this way.
I don't believe my quoting altered the meaning of the quotes, but people are free to read your posts in their original context if they wish to:
http://www.cplusplus.com/forum/lounge/198792/2/#msg955188
http://www.cplusplus.com/forum/lounge/198792/2/#msg955189
http://www.cplusplus.com/forum/lounge/198792/2/#msg955213

If you are old (or an adult) why would you be in this particular post anyways?
I post where I feel like it, as does everyone else.

If you don't agree with me just leave it.
No.

Especially since I am a kid and you are arguing with a kid about the "right " thing.
I have no means of confirming your age, nor do I care what it is. Ideas are judged and discussed on their own merits, regardless of who puts them forward. If I think you're spewing bullshit, I will tell you "you're spewing bullshit".

It really seems like a older guy is abusing a kid telling him the "right" thing.
I've said it before and I'll say it again: if you're not mentally equipped to deal with confrontation, you're free to stop posting and reading replies. No one is required to withhold their opinions to spare your feelings.

My opinion [...], is that even though I do not decide what people do or what is best for them, we should at least try to make a change to make it "better"
The assertion that taking action in the previously described situations is overall "better" is itself also part of your opinion. It's not demonstrably true, and the consensus appears to be that it would be worse, not better.

It is like watching the world falling and without doing anything to change that.
A person no doing their homework does not, in fact, lead to societal collapse.

If you disagree, you got a better idea?list it here then.
What we do right now is, in my opinion, better. That aside, it's not necessary to give an alternative to refute a position. For example, we currently don't know where gravity comes from, but "it's pixies pulling things down" would not be an acceptable explanation.

I don't want all this to be a fight and stuff, its just a place where we share ideas.
Hmm...
If you don't agree with me just leave it.
Are you suffering from cognitive dissonance or do you just have unusual definitions of the words "share" and "ideas"?
WheatFieldOnFire wrote:
So hi if you know me... My original name is Thedudeplaysmc. Then to Thedudeplaysmc3, then to this name. Why I kept changing usernames???

I KEPT HAVING LIMITED FUNCTIONS AND DID NOTHING WRONG.

For those people that might know me, did i ever say something offensive or bad (maybe I might have but not a lot)? If I keep getting this thing I will just switch to a new c++ forum. They wouldn't ban me.

Or, shall I say, there is a mod that is doing this? Ever since I changed from username Thedudeplaysmc3, I kept having this stupid problem! Anyone might help me on this? I don't want to help people and keep getting banned.

٩(●˙—˙●)۶(๑♡∀♡๑)(๑¯ω¯๑)(´⊙ω⊙`)(´⊙ω⊙`)(=゚Д゚=)●︿●(◐∇◐*)╯﹏╰ ̄へ ̄= ̄ω ̄=<(-︿-)>ฅ(๑*▽*๑)ฅ!!〣( ºΔº )〣凸(>皿<)凸(ノ*>∀<)ノ♡o(╥﹏╥)o( TДT)(。•́︿•̀。)(╥╯﹏╰╥)ง(๑-﹏-๑)Σ>―(〃°ω°〃)♡→(((o(*>ω<*)o)))


You have a lot of names there, WheatFieldOnFire. I kept this secret until the end before your first post got deleted.

You might have done something wrong here. You should be banned, no?
The problem with WheatFiledOnFire, or whatever he wants to go by is that he "helps" people by giving them bad practices as advice, erroneous advice, tries to dictate site policy, and is borderline trolling at this point.
closed account (1vRz3TCk)
Is not the horse dead yet?
people thinks I am the bad guy, especially BHX, where he starts to say I am telling people bad stuffs.

Well if you don't want to be called on giving bad advice, maybe stop giving it?

Called out here for bad advice, but rather than remove it you argue "it worked for me".
http://www.cplusplus.com/forum/beginner/201195/#msg959364

Here you show you don't fully understand if/while/do-while statements, but give advice on them anyways:
http://www.cplusplus.com/forum/beginner/200374/#msg956531

Here you are partially right, so you get some points for this one. You are right, return isn't needed in a class declaration because it is illegal and a good compiler should give an error for it:
http://www.cplusplus.com/forum/beginner/200978/#msg959062

The problem many have with you is that when people point out where you are wrong (this thread for example), instead of admitting you are wrong you go on the defensive and argue.

Tell me where I am wrong and I will see if that is actually correct, shall we?

*blinks* Have you not paid any attention to cire's or helios's remarks?

Here is a quote from you from the first link about bad advice:
It might be bad practice but It worked.

It's a bad practice to break your finger to get your mind off a headache. Sure it works, but doesn't mean anyone should actually do it. Yet that is exactly what you are arguing in that reply. That line comes across as: "It's bad practice, illegal according to c++ rules, but it works so it doesn't matter."
Last edited on
> Called out here for bad advice, but rather than remove it you argue "it worked for me".
> http://www.cplusplus.com/forum/beginner/201195/#msg959364


To: "That's not ugly - it's illegal C++." without any supporting reference,

I don't see anything even mildly objectionable in the response:
"I did it before, and it worked. Even though its ugly (or illegal if you call it), it worked for me."

Note that there is no claim that the construct is valid C++; in fact there is at least tentative acceptance that it is an illegal construct. "I did it before, and it worked" is merely stating a fact - something that is almost certainly true.
Why it did work is actually worth discussing.


WheatFieldOnFire, to repeat what was said earlier:
Continue to try to help others in the programming forums to the best of your ability. Don't be afraid of making mistakes. As long as it is public, even if you have made a mistake, someone would be there to correct it, and you too would learn something.


Hopefully you (and a few others) would have learnt something useful from the replies to "I did it before, and it worked". Unlike the several pages in this particular thread, I might add.
> It worked for me on 2 compilers/IDEs

Repeat:
Many C++ compilers with their default settings compile a language that is close to, but is not standard C++.
So it might have compiled cleanly if conformance to C++ was not specifically asked for.
For instance, clang++, g++ without -pedantic-errors:
http://coliru.stacked-crooked.com/a/fa75618787da0ffd

http://www.cplusplus.com/forum/beginner/201195/#msg959562

Tip: With the GNU compiler, compile C++ code with -std=c++11 -Wall -Wextra -pedantic-errors
The standard says main is the entry or starting point for the program. Having two mains is the equivalent of trying to go through your front door twice without first going back out of it. If it compiles for you, then it tells us you aren't making the compiler adhere to the C++11 standard as it should give errors for using it again. For example, using JLBorges' compiler flags, compiling this code:
1
2
3
4
5
6
7
8
#include <iostream>
using namespace std;

int main()
{
      main();
      return 0;
}

Compiled against
g++ -g -std=c++11 -Wall -Wextra -pedantic-errors -c test.cpp
gives this error
test.cpp:6:7: error: ISO C++ forbids taking address of function '::main' [-Wpedantic]
.
cpp shell is not the gold standard of C++ standard compliance, especially since it does not offer -pedantic (only -Wpedantic).

EDIT:
WheatFieldOnFire wrote:
and I checked all of this:
Many (-Wall)
Extra (-Wextra)
Pedantic (-Wpedantic)
-Wpedantic is a weaker form of -pedantic. Errors that would be generated by strict standards compliance (-pedantic) are instead downgraded to warnings. They are not equivalent. Furthermore, just look at the text of the error. "ISO C++ forbids". You can't get a much clearer indicator that something is illegal than that.

EDIT2: -Wpedantic and -pedantic are aliases. cpp shell still doesn't support -Werror or -pedantic-errors, however.

-Albatross
Last edited on
I know it is illegal in c++ but then why would it let me compile?

Because GCC compilers in particular tend to add a lot of extensions to the languages they support because their maintainers want feature X that might be time-consuming or impossible to get into the language standard. Hence why -pedantic exists: to disable those added features if you want to write strictly standards-compliant code.

So why did this website use it then?

No clue. Up until this website got an integration with cpp shell, I'd never even heard of the site. That said, they do offer support for linking against Boost, which is extremely nice. It's also possible that they have some nicer API than other similar websites.

-Albatross
WheatFieldOnFire wrote:
OK then according to BHX, if I checked the warnings it would not let me compile. Why did I compile it then?
To reiterate, -Wpedantic is a weaker version of -pedantic. It merely warns of deviations from the standard that the compiler otherwise supports.

-pedantic generates errors instead, and is preferable to -Wpedantic unless you want those extensions while remaining aware of when you're using them.

cpp shell, however, doesn't let you use -pedantic. Only -Wpedantic.


EDIT: An assumption was made. The above statement is incorrect.

-Albatross
Last edited on
You really should not call that person by her name. The person is a teenager girl, you should at least show her some respect of yours.

For the record, my real name does not have the word "Albatross" anywhere in it, and I'm not a teenager.

Albatross was my old alias on this site. I've no problem being called as such. Most of the reason I changed it because of a) a funny story, and b) Albatross being an alias I've seen other people use on other sites in cases where I wouldn't mind a (mostly) unique identifier.

-Albatross
There is no difference between -Wpedantic and -pedantic (generate warnings).

-pedantic-errors and -Werror=pedantic generate errors.

These primarily cover erroneous program constructs other than those that engender undefined behaviour.
[Note] ... Many erroneous program constructs do not engender undefined behaviour; they are required to be diagnosed. [—end note] - IS


WheatFieldOnFire, to clarify, the IS specifies:
The function main shall not be used within a program.


And http://www.iso.org/iso/how-to-write-standards.pdf says
ISO uses the following words to make the distinction :
Requirements : shall, shall not
• Recommendations : should, should not
• Permission : may, need not
• Possibility and capability : can, cannot

PS: I didn't know the difference between shall, shall not and should, should not till Cubbi told me about it.
For the record, when I said
g++ -g -std=c++11 -Wall -Wextra -pedantic-errors -c test.cp
I was using JLBorges's example and using the command line compilation commands and flags; though I do always include the debugger flag too. As for Code::Blocks, it's a little screwy. On my Code::Blocks I have -pg -g -Wall -Wextra and -pedantic-errors checked, but when you look at the build log you get treated to this:
mingw32-g++.exe -pedantic-errors -Wextra -Wall -std=c++11 -pg -g -Wpedantic -pedantic-errors -pedantic -Wextra -Wall -std=c++11 -pg -g  -c 


Last edited on
Whoops. It seems like I've been propagating misinformation.

I made an assumption that -Wpedantic followed the trend of most -W flags (with -Werror and -Wfatal-errors being notable exceptions) of only generating warnings (or am I wrong about -pedantic rejecting certain programs as well?).

I can, however, still give cpp shell crap in that case for not providing -Werror or -pedantic-errors.

-Albatross

EDIT @ post below because talk about my gender is a massive tangent and don't feel like wasting another post on myself: my gender is listed on my public profile on this site which anyone can access.
Last edited on
closed account (1vRz3TCk)
cpp shell is not the gold standard of C++ standard compliance
So why did this website use it then?
Because the creator if this site created that site.
If cpp.sh must be used (it provides an old non-conforming version of the GNU compiler/library)

1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>

int main ()
{
    std::cout << "g++ " << __GNUC__ << '.' << __GNUC_MINOR__ << '.' << __GNUC_PATCHLEVEL__ << '\n' ;
    
    if( __GNUC__ < 5 ) 
    {
        std::cout << "*** warning: use at your own risk - many things are broken/missing in this old vesion.\n" 
                  << "             for instance, std::string and std::list are broken, <codecvt> is missing.\n" ;
    }
}


Plug this in right at the top: #pragma GCC diagnostic error "-Wpedantic"

1
2
3
4
5
6
#pragma GCC diagnostic error "-Wpedantic"

int main( int argc, char* argv[] )
{
    if( argc > 1 ) main( argc-1, argv ) ;
}
Last edited on
The smallest, legal C++ program you can make is:
 
int main(){}


https://en.wikipedia.org/wiki/Directive_(programming) <- #pragma is a preprocessor directive like #define #ifdef #ifndef #endif etc.

For example:
1
2
3
#pragma once

// includes, functions, other header data 

At the top of header files serve the same purpose as:
1
2
3
4
#ifndef HEADER_H
#define HEADER_H
// includes, functions, other header data
#endif 

Last edited on
closed account (E0p9LyTq)
what is pragma?

http://en.cppreference.com/w/cpp/preprocessor/impl

Interesting the C++ ISO standard doesn't require implementations support any pragmas, yet the C ISO standard requires 3 pragmas be supported.
Topic archived. No new replies allowed.
Pages: 1234