Skip to the task
Layout
Back to classic view

You are looking at lesson 1. Your place is still lesson 8, task 1: Memory.

CHECKTask 12 of 21 · step 5: Special charactersRead the error: a single \ in a path
Read the error: a single \ in a path in practice/01/

In the path write C:\course instead of C:\\course and click ▶. Why is \c an error, while C:\new would give none?

Numbered notes in the code explain the important lines.

Details & hint
C:/.../practice/01/main.c:15:53: error: unknown escape sequence: '\c' [-Werror]
   15 |     printf("File: C:\course\\practice\\01\\main.c\n");
      |                                                     ^

Stuck? \c is not an escape sequence, so GCC complains. But \n is one: C:\new would print C:, and ew on the next line, with no error at all. In a path always write \\.

practice 01 main.c Code Diff +6
M · MODIFIED Green = add, blue = change, red mark = removed line.
#include <stdio.h>
int main(void) {
printf("Hello, world!\n");
printf("\n");
printf("Algorithm: the average of grades\n");
printf("1. Add up all the grades.\n");
printf("2. Count how many grades there are.\n");
printf("3. Divide the sum by the count.\n");
printf("4. Print the answer.\n");
printf("\n");
printf("Grade\tMeaning\n");
Note 1: \t is a tab: a jump to the next column.
printf("10\t\"excellent\"\n");
Note 2: \" is a quote inside the string.
printf("5\t\"satisfactory\"\n");
printf("File: C:\\course\\practice\\01\\main.c\n");
Note 3: \\ is one \ in the path.
printf("Done: 100%%\n");
Note 4: %% is one % in a printf string.
return 0;
}