It isnt meant to replace docs and books. But for someone who doesnt have a helpful teacher it can give some basic help.
It isnt meant to replace docs and books. But for someone who doesnt have a helpful teacher it can give some basic help.
So let me get this straight, you can't figure out one homework and after wasting our time here you decided to quit. Well, good luck in your future endeavours, this kind of behaviour will not get you too far, regardless of your career choice.
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.
Tell you what... I saw your note about switching majors... however, if the impression I'm getting is even 25% right... you need to switch SCHOOLS, not majors.
Lots of people learn C as part of other courses... the basics take about 3 weeks with homework... schools have been doing it for nearly 30 years... There is simply no excuse for a school to teach garbage "pseudocode" instead... It sabotages you for actual programming tasks later on...
(Yes, programmers sometimes us pseudocode in solving complex problems... but there's not one of us under any illusion of it actually compiling or working until it's translated into an actual programming language...)
Last edited by CommonTater; 05-12-2011 at 11:20 AM.