I am a noob and this is my first post so hello and i would like to know if you can tell me what is wrong with my code i am just starting c so her is my C program Code: #include <stdio.h> int main(void) { // insert code here... printf(“Why does every programmer look like this...\n”); printf(“~~\n”); printf(“-00-\n”); printf(“-\n”); printf(“U\n”); return 0; } the compiler puts the words error: syntax error at 'OTHER' token below every line that has printf on it
Try this : (It might look same, but after careful observation, you can spot the difference(s) ) Code: #include <stdio.h> int main(void) { // insert code here... printf("Why does every programmer look like this...\n"); printf("~~\n"); printf("-00-\n"); printf("-\n"); printf("U\n"); return 0; } Copy the exact code above and paste in your IDE and compile it. Tell me the result.
Can you please tell me what is the difference between the above and yours code. I think " " are the first.And syntax highlight is second one.Am i right?
haha i see with the quotes whoops well i wrote the code in a text editor and the i copied it and pasted into the compiler thx tho
Code: #include <stdio.h> int main (void) { printf("\n2+2= %d”, 2+2"); return 0; } now what is wrong with that code i am trying to add 2+2 and display it
LOL, I think you are confused with printf syntax. Try this : Code: #include <stdio.h> int main() { printf("\n2+2 = %d", 2+2); return 0; }
Oh I see all I had to do was remove that last quote . Thx a bunch I'm sure I'll have many more questions tomarrow Are their any good c tutorials on here
Instead of a list of hundreeds of beginner tutorials do u know just one that is really good that goes beyond beginner
I don't think you read the link that I had mentioned, carefully. Just after the list, someone posted a similar question. And as shabbir answers : "All are good to start with. but the Bjarne Stroustrup's and 21 days are good to look at."
Do u know of any really good ones because there is a list of about 50 there also do u know one that goes from beginner level and beyond instead of stopping after the basics Thx
That's OK. I hope learning C won't be difficult for you. (We are here to help, if you face any difficulty )