Wednesday, July 22, 2009

What am i doing?

I got back the test today. Although i got 8.3/10 which is the highest mark in the class, i still feel that i had been scold by teacher today. She said "I know the topic 'pointer' is very hard for you but at least you must get the basic things correct. All the things i teach in programming 1, you still don't get it correct."

After i received it, i see through. Yeah, i got a lot of mistakes and all of them is from programming one. For example.

Click into it to see the silly mistake. Declaration of pointer ptr should be
[char *ptr;]
And what did i write?
[char *char]
Fck......

Next things is another stupid mistake. Everyone should be able to do it correctly.
The scan set should be
[scanf(" %[^\n]", pname);]
And what did i write?
[scanf(" %[^/n]",pname);]
Fck again.....I need to learn how to differentiate what is backslash and slash.


Lastly, i make a mistake that myself cannot accept....
The string should be copied used
[strcpy(tempname, pname+j*L);]
However, i used integer assignment.
[tempname=pname+j;]

Grrrr.....next time i must be more concentrated. Must eat until full before go school so that i will have enough energy....

No comments:

Post a Comment