Well, I've gotten a C thing to do, now I'm used to C++, and don't know what I can do in C++, which I can't do in C, so how to i make VS2008 C++ check for C errors and such stuff?
Well, I've gotten a C thing to do, now I'm used to C++, and don't know what I can do in C++, which I can't do in C, so how to i make VS2008 C++ check for C errors and such stuff?
Currently research OpenGL
Just name your source files with .c, instead of .cpp, and VC++ will compile it as a C program.
OS: Linux Mint 13(Maya) LTS 64 bit.
Yeah, I tried that
C is complicated D: move on to C++, I say!
Currently research OpenGL
So when you try to build your .c file, what error messages do you get?
OS: Linux Mint 13(Maya) LTS 64 bit.
oh it worked
just that C has other complicated stuff, that C++ doesn't xP
Well, I wanna ask what stuff like '%2.2f' does o.O?
Currently research OpenGL
Ok, I think I figured it out, when used in printf, it sets how many numbers and decimals, correct?
Currently research OpenGL
Yep.
I thought you said it was difficult? How come you're guessing it all right then?
Well, 'cause I looked at the output and the numbers, and saw that they had something in common xP
But I do very well notice that C++ is easier
Currently research OpenGL
This is not something specific to C. Format strings are probably the most convenient ways to describe complex formatting and exist in other languages too. Think how you'd need to chain complex manipulators with cout to achieve the same simple effect.'%2.2f'
Also extremely useful when internationalizing programs: fragments of sentences as cout takes them may not be translateable, whereas format strings with place-holders for numeric values are. Although here positional arguments might be even better (not possible with C printf I think): e.g "Copied %1 files from %2" - the values of %1 and %2 might not naturally come in the same order in a foreign language but you'd be able to write: "ZZZ %2 djhs: %1"
printf is available in C++ (although it is often not recommended because of type unsafety - a variadic function works on arguments without really knowing their type beyond what the coder says in the format string). In a type-safe way it is also available as boost::format.
Format strings are recommended learning, I think.
I might be wrong.
Quoted more than 1000 times (I hope).Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.