I just need some information about all kinds of usuall (syntax,logic,...)errors in c and how to correct them.
I just need some information about all kinds of usuall (syntax,logic,...)errors in c and how to correct them.
No problem. I'll just tell you everything I know about things that took me years to learn, and which I still don't know 1% of everything about, because you asked so vaguely for everything and couldn't be bothered to Google, say, "common C errors" or similar?
Just what kind of response were you expecting?
- Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
- A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
- The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.
Write programs. Your bound to make mistakes. When you do, copy/paste the errors into google. You should get alot of hits with users having gone through the same problem
Heh, I need my car battery replaced.. wait why am I posting here?
1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.
Never mind I figured it out. Thanks anyways. I don't know how to delete posts so that is why I didn't.
"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson