#include<stdio.h>
#include<math.h>
int main(x)
{
int y,z;
y=-~x;
z=printf("hi\r");
printf("%d",x = pow(z,y));
}
output :- 9i
Please explain how 'x' is taking some int value
#include<stdio.h>
#include<math.h>
int main(x)
{
int y,z;
y=-~x;
z=printf("hi\r");
printf("%d",x = pow(z,y));
}
output :- 9i
Please explain how 'x' is taking some int value
Last edited by vivekgupta; 06-12-2012 at 04:51 PM.
Please use code tags.
Where are you getting this horrible code? main() is declared incorrectly, but what's probably happening is that “x” is being passed the argument count (what is traditionally called argc). Since this is a pre-ANSI declaration, and no type is given for “x”, it defaults to int, which is why it'd be taking "some int value".
I highly recommend that, if you're actually interested in learning C, you stop going to whatever site/reading whatever book is giving you this junk. It's worthless.
Yes, please. You've already been told this before. Persisting in learning rubbish is futile. (Okay, it is not completely rubbish, but the trivia that this involves just hinders your useful learning.)Originally Posted by cas
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Can't tell if crossposter, or just copied from here. FFS, you need to learn the basics of C before you even touch bitwise operations.
Also, why are all of your topics pretty much:
*some ........ed-up code*
output :- *some undefined error*
Please explain *something obvious*
So please say which book should i read to learn C from 'very basic' to a better and better level ?? And Should I learn C++ because my friend told me to learn C++ direct
Last edited by vivekgupta; 06-13-2012 at 03:35 AM.
Here's a list of things to watch out for when choosing a book. If you see any of these, put it down and find another book.
The title contains adjectives like "guru" or "dummies"
The title mentions a specific compiler like "TurboC"
The title mentions a timescale like "21 days" (see Teach Yourself Programming in Ten Years)
Skim the code examples in the book. If you see any of these, put it down and walk away.
void main()
gets(buffer), unless it is a single example telling you NOT to use it (which would be a positive sign)
fflush(stdin)
The author is "herbert schildt", Showing 1 - 12 of 154 Results
For those who can't do maths, that's one new book or edition every 3 weeks for a solid decade!
"written by" should be read as "cobbled together by an army of ghost writers, then rubber stamped by HS"
bullschildt
This site has a number of reviews
ACCU :: Book Reviews Search
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
In addition to what Salem said, I will specifically recommend against Let Us C by Yashavant Kanetkar; this book is ridiculously bad. I mention it only because it is a popular book in India and your username implies that you might be Indian.So please say which book should i read to learn C from 'very basic' to a better and better level ??
As for C++, you should learn it if you want to learn it.
How did YK get Turbo C to run on Linux???
lol Let Us C by YK can be used as a book to refer to so as to know how not to code :P ...
For C++, you dont need to start out with C. If your final aim is C++, better you start of directly with it than going about in circles ...