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.
Please note that he doesn't use the term 'address'.
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.
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.
Yes it does. You had said
His points seems to imply something different.No, pointers don't point to values, they point to locations in memory.
Last edited by Overworked_PhD; 05-01-2010 at 04:49 PM.
We should get you two a room
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
I'm not proficient with C, but I know enough that I could run circles around you in real life. Seriously, if we ever had a real life programming show down, I would clown you on every programming problem. I wouldn't need google or any other resource to aid me either.
And when I say every programming problem, I'm talking about problems ranging from sorting algorithms to operating system (paging) algorithms to basic compiler construction.
[QUOTE=Overworked_PhD;942903]Yes it does. You had said
Yes he uses the word aim, to indicate that the pointer used in that example is pointing to an address where a value of type double is stored you troll. He is correct in his explanation but he is using troll language because he knows he is dealing with an idiotic question. It's called Irony, however you need to have a certain level of education to be able to cast that magic power. Otherwise, you will find yourself to not have sufficient "mana'.No, pointers don't point to values, they point to locations in memory.
[/code]
His points seems to imply something different.
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.
[QUOTE=Overworked_PhD;942903]Yes it does. You had said
Only if you don't speak English. As a native English speaker, I can vouch for the fact that his post does, in fact, imply that the pointers point to objects stored by the program (presumably in memory).No, pointers don't point to values, they point to locations in memory.
[/code]
His points seems to imply something different.
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.
Yeah right. I told you before I don't have that much time to troll around with you on "programming competitions". I have a real life, a job and a family to worry about. Besides what would you do without a direct link to Dr. Sosman to ask what you are doing wrong whenever you get schooled on something, a phenomenon that has been occurring every day for the past week.
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.