ThisIsNotAUzrName
ThisIsNotAUzrName

Reputation: 33

This specific C code snippet doesn't seem to build and run in the Code:Blocks IDE

Yes, I had googled the specific problem, which was a /n snippet of the code, but it gives me error messages.

Here's the code

{
    printf("Godsmack" \n);
    printf("I don't watch movies" \n);
    printf("My cat likes Adventure Time" \n);
    printf("11 meters per second" \n);
}

The error messages read: Line 10 (first line):

... error: stray ‘\’ in program
     printf("Godsmack" \n);
                       ^

And line 10:

... expected ")" before ‘n’

Line 11 (same messages)

Upvotes: 0

Views: 27

Answers (1)

phoenixstudio
phoenixstudio

Reputation: 2598

Your \n needs to be part of your string:

{
    printf("Godsmack \n");
    printf("I don't watch movies \n");
    printf("My cat likes Adventure Time \n");
    printf("11 meters per second \n");
}

Upvotes: 1

Related Questions