I have a really funny answer
Declare variable names that are keywords in C++ but not C.
#include < stdio.h >
int main(void)
{
int old, new=3;
return 0;
}
This will compile in C, but not in C++!
Monday, July 9, 2007
Subscribe to:
Post Comments (Atom)
12 comments:
isn;t this a stupid question
yep, sounds stupid but tricky though. Btw good reply
main()
{
const int a;
printf("%u",&a);
}
this cprogram will compile in turboc++
#include"iostream.h"
void main()
{
const int a;
cout<<&a;
}
this c++program will not compile in turboc++.
1)We can assign any type of pointer to void pointer without cast in c but not in c++.
2)
int main()
{
const int i;
}
will not give error in c but in c++.
In c++ We must initlize the const variable .
You can try with const int a=0
Might will work
In c++ We must initlize the const variable .
You can try with const int a=0
Might will work
The "designated initializer" syntax in ISO C99 is not available in C++.
http://stackoverflow.com/questions/1601201/c-struct-initialization-using-labels-it-works-but-how-documentation
http://gcc.gnu.org/onlinedocs/gcc-4.4.1/gcc/Designated-Inits.html#Designated-Inits
Hello! I simply wish to give you a big thumbs up for your excellent information
you have right here on this post. I'll be coming back to your site for more soon.
Here is my web-site - metabolic rate calculator
I definitely liked reading everything that is posted on your website. Where else could anyone get that type of facts in such a perfect way of writing?
www.triciajoy.com
Your method of describing everything in this article is in fact pleasant, every one can easily be aware of it, Thanks a lot.
Excellent blog here! Also your website loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol
Excellent post. I was checking constantly this blog and I'm impressed! Very useful info specially the last part :) I care for such information much. I was seeking this particular info for a very long time. Thank you and good luck.
Post a Comment