Hi! First of, I am completely new to C (and programming in general), so there might be some paramount error that I haven't noticed.
Ok, so I am going through the 'Learn C the Hard Way' (because no other tutorial have been so good before), and I have encountered a problem with trying to write a string (or char array).
Code:
I am running Ubuntu in a VirtualBox, and using nano to write the program. When I try to make (compile?) the program, I get the following errors: "test.c:5:1: Error: Stray /302 in program" and "test.c:5:1: Error: Stray /240 in program", and in Terminal, the error points to the first c in the 'char'.Code:# include <stdio.h> int main() { char full_name[] = "William Lastname"; printf("My full name is: %s", full_name); return 0; }
I did some research and found out that the stray error is due to non-standard ASCII characters and most likely due to the wrong kind of quotation marks and that this was most likely due to having copying/pasted the code from one area to another, but as previously stated, I am using nano in Ubuntu so I don't really see where the problem might have originated.
Can someone help me figure out how to fix the problem?