More FAQ updates

Pages: 1234
I finally have some time to hammer out some of the FAQs.

http://www.cplusplus.com/faq/beginners/exponentiation/

Plus updates (hopefully these are less combative now):
http://www.cplusplus.com/faq/beginners/pointers-and-references/
http://www.cplusplus.com/faq/beginners/call-by/

I know that there's a good reason I put "operator precedence" as it's own FAQ, but I don't remember any specific examples of problems people have had with it. If anyone can point one (or more) out, that'd be great! (Else it may disappear for a while.)
In exponentiation:
Function allowing raising arbitrary base into arbitrary power called pow. exp is a single argument function calculating earg.

I know that there's a good reason I put "operator precedence" as it's own FAQ, but I don't remember any specific examples of problems people have had with it. If anyone can point one (or more) out, that'd be great!
foo || bar && baz e.g. true || false && false — why the result is true instead of false?

*foo.bar / *foo->bar — you need to use (*foo) here.

Problems in I/O statements:
1
2
std::cout << std::boolalpha << 
             "A is larger than b: " << a > b
and all operators with precedence lower than i shift operators.
Holy crap! Fixed.

re: || and && get's its own faq
re: everything else, ty.
In strtok(), I noticed the last graphic (strtok-6.gif, I think) forgot the NUL character that replaced the comma in the previous one.
Wow, nice catch! I'll fix that tomorrow. (It's past my bedtime now, and my wife is getting sad that I'm not there, so I'll go cheer her up :O)

[edit] Fixed: http://www.cplusplus.com/faq/sequences/strings/strtok/
Last edited on
Great work Duoas, it's nice to see new material. =]

Any time for that comprehensive and well written ncurses tut? ;]
I wish. Unfortunately, the NCurses/Console tutorial is in the "wanna do" bin and the FAQ is in the "must finish" bin. Thanks though!
Ah not to worry, it was worth a shot... What if I take you and the family to Disneyland? ;]

You know Duaos I'm eager to get my fingers dirty in some articles and tutorials so if you ever want anyone to proof read or an extra pair of eyes I'm more than up to collaborate. Just keep it in mind.

I'm thinking about writing an article(Series?) on OS Dev for the absolute beginner. However the code after the assembly will be in C so I'm unsure of it's place on this website, however I wrote 2 tools in C++ to help aid in development ( Just a simple Hex viewer and Floppy disk image creator that writes the boot sector to the image ) that new programmers may find interesting ( And potentially find uses for programming rather than the foo/bar useless examples of programming ).

Shadowing someone who has wrote articles before may be able to help me to properly word and format the texts.

Also a little unrelated but great work on your previous post about writing WAV files from scratch, found your code *EXTREMELY* interesting.
Hey, thanks. If there's anything in the FAQ you think you are up to writing, feel free to send me a draft and I'll probably use it.

As for articles, when you write one, I'll be happy to proof it too. No matter how good a writer someone is, he (or she) will always benefit from having someone else look it over to catch all the really dumb mistakes.
New FAQ: Logic Problems
http://www.cplusplus.com/faq/beginners/logic/

Whew. May your eyeballs enjoy! (Did I miss anything?)
In the end of the section on if(x = 7), when you mention using parentheses around assignments in conditionals, you used the equality operator instead of the assignment operator that I think you meant.
If you could send me your "Need to complete" bin rather than me having to click all the links in the FAQ to see what needs doing that would be much appreciated. ;]
@Zhuge
Woops! Fixed.

@megatron 0
http://www.cplusplus.com/forum/lounge/60389/
Can anyone explain what am I looking at? http://puu.sh/iy9eR/d909a9df8e.png
New FAQ: http://www.cplusplus.com/faq/beginners/main/

@MiiNiPaa
Yeah, you're right. I'll make an image of it... [edit] Fixed. [/edit]
Last edited on
My copy of both 2003, 2011 and early draft of 2014 standard all list [basic.start.main] under 3.6.1, not 3.1.6.1.

And a minor nitpicks:
1) paragraph number should be distinct from section number, or you would not be able to distinguish 4.2, which describes context where implicit conversion can take place, from 4.2, which describes rules for array-to-pointer conversion.
2) In some case it would be nice to see version of the standard, as sometime section/paragraph numbers are changing.
New FAQ: http://www.cplusplus.com/faq/beginners/command-line-arguments/

@MiiNiPaa
Heh, mine too.
Thank you for catching that! IDK what was going on in my head.

I've changed it to "3.6.1/3", which seems to be a convention. (Though I don't know why the committee numbered it ambiguously like that.) In any case, I think I have to fix a couple of other spots too, then.)

[edit] I think I found and fixed them all here http://www.cplusplus.com/faq/beginners/undefined/
Last edited on
Can I pick your brains?

I have a FAQ for "issues with for loops".
But, alas, I cannot remember what the issues I had in mind were when I created that title. (/me bad)

Can I get some examples of problems you have seen newbies have with for loops?
Pages: 1234