Knowee
Questions
Features
Study Tools

Compiler Message/home/ubuntu/Main.cpp:20:20: warning: missing terminating " character 20 | printf("Invalid type entered! | ^/home/ubuntu/Main.cpp:20:20: error: missing terminating " character 20 | printf("Invalid type entered! | ^~~~~~~~~~~~~~~~~~~~~~/home/ubuntu/Main.cpp:21:1: warning: missing terminating " character 21 | "); | ^/home/ubuntu/Main.cpp:21:1: error: missing terminating " character 21 | "); | ^~~/home/ubuntu/Main.cpp:27:20: warning: missing terminating " character 27 | printf("Integer: %d | ^/home/ubuntu/Main.cpp:27:20: error: missing terminating " character 27 | printf("Integer: %d | ^~~~~~~~~~~~/home/ubuntu/Main.cpp:28:1: warning: missing terminating " character 28 | ", *(int*)value); | ^/home/ubuntu/Main.cpp:28:1: error: missing terminating " character 28 | ", *(int*)value); | ^~~~~~~~~~~~~~~~~/home/ubuntu/Main.cpp:31:20: warning: missing terminating " character 31 | printf("Float: %.2f | ^/home/ubuntu/Main.cpp:31:20: error: missing terminating " character 31 | printf("Float: %.2f | ^~~~~~~~~~~~/home/ubuntu/Main.cpp:32:1: warning: missing terminating " character 32 | ", *(float*)value); | ^/home/ubuntu/Main.cpp:32:1: error: missing terminating " character 32 | ", *(float*)value); | ^~~~~~~~~~~~~~~~~~~/home/ubuntu/Main.cpp: In function ‘int main()’:/home/ubuntu/Main.cpp:22:13: error: expected primary-expression before ‘return’ 22 | return 0; | ^~~~~~/home/ubuntu/Main.cpp:29:13: error: expected primary-expression before ‘break’ 29 | break; | ^~~~~/home/ubuntu/Main.cpp:33:13: error: expected primary-expression before ‘break’ 33 | break; | ^~~~~Sample TestcaseTestcase 1 - FailedExpected OutputInteger: 4OutputTestcase 2 - FailedExpected OutputFloat: 5.50OutputTestcase 3 - FailedExpected OutputInvalid type entered!

Question

Compiler Message/home/ubuntu/Main.cpp:20:20: warning: missing terminating " character 20 | printf("Invalid type entered! | ^/home/ubuntu/Main.cpp:20:20: error: missing terminating " character 20 | printf("Invalid type entered! | ^~/home/ubuntu/Main.cpp:21:1: warning: missing terminating " character 21 | "); | ^/home/ubuntu/Main.cpp:21:1: error: missing terminating " character 21 | "); | ^/home/ubuntu/Main.cpp:27:20: warning: missing terminating " character 27 | printf("Integer: %d | ^/home/ubuntu/Main.cpp:27:20: error: missing terminating " character 27 | printf("Integer: %d | ^~/home/ubuntu/Main.cpp:28:1: warning: missing terminating " character 28 | ", (int)value); | ^/home/ubuntu/Main.cpp:28:1: error: missing terminating " character 28 | ", (int)value); | ^/home/ubuntu/Main.cpp:31:20: warning: missing terminating " character 31 | printf("Float: %.2f | ^/home/ubuntu/Main.cpp:31:20: error: missing terminating " character 31 | printf("Float: %.2f | ^~/home/ubuntu/Main.cpp:32:1: warning: missing terminating " character 32 | ", (float)value); | ^/home/ubuntu/Main.cpp:32:1: error: missing terminating " character 32 | ", (float)value); | ^~~~~~~~~/home/ubuntu/Main.cpp: In function ‘int main()’:/home/ubuntu/Main.cpp:22:13: error: expected primary-expression before ‘return’ 22 | return 0; | ^~/home/ubuntu/Main.cpp:29:13: error: expected primary-expression before ‘break’ 29 | break; | ^/home/ubuntu/Main.cpp:33:13: error: expected primary-expression before ‘break’ 33 | break; | ^~~~~Sample TestcaseTestcase 1 - FailedExpected OutputInteger: 4OutputTestcase 2 - FailedExpected OutputFloat: 5.50OutputTestcase 3 - FailedExpected OutputInvalid type entered!

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The error messages you're seeing are due to missing closing quotation marks in your printf statements. Here's how you can fix them:

  1. On line 20, you have printf("Invalid type entered!. It should be printf("Invalid type entered!");.

  2. On line 27, you have printf("Integer: %d. It should be printf("Integer: %d", *(int*)value);.

  3. On line 31, you have printf("Float: %.2f. It should be printf("Float: %.2f", *(float*)value);.

After making these changes, your code should compile without any errors.

This problem has been solved

Similar Questions

home/ubuntu/Main.cpp: In function ‘int main()’:/home/ubuntu/Main.cpp:60:13: error: ‘exit’ was not declared in this scope 60 | exit(0); | ^~~~

/home/ubuntu/Main.cpp: In function ‘int main()’:/home/ubuntu/Main.cpp:7:35: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive] 7 | result = (m >= 6.0 && s >= 50.5) ? "Eligible for Next Round" : (m < 6.0 || s < 50.5) ? | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | const char* 8 | "Not Eligible" : "Try again..."; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/ubuntu/Main.cpp: In function ‘int evaluateexpression(char*)’:/home/ubuntu/Main.cpp:29:12: error: ‘isdigit’ was not declared in this scope 29 | if(isdigit(token[0])){ | ^~~~~~~

/home/ubuntu/Main.cpp:3:15: error: expected unqualified-id before ‘int’ 3 | char register(int weight, double height) { | ^~~/home/ubuntu/Main.cpp:3:15: error: expected ‘)’ before ‘int’ 3 | char register(int weight, double height) { | ~^~~ | )/home/ubuntu/Main.cpp: In function ‘int main()’:/home/ubuntu/Main.cpp:30:16: error: expected primary-expression before ‘register’ 30 | category = register(weight, height); | ^~~~~~~~

above codes show errors about: missing terminating " character 18 | fprintf(temp, "%d %d | ^~~~~~

1/3

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.