Did i do this right (C++)??

incorporate
employing namespace std;

int key ()

char term00;
char end result;

term00 = eliminate all programs;
end result = term00;

cout << end result;

returning 0;

No.How much does the compiler inform you Does it offer you any safety measures or fault notifications

No, term00 is actually of variety character, it cannot shop a stringed
term00 might only keep characters for example ‘a’, ‘b’, ‘c’ etc ….
A similar is so with end result.(Since you’re assigning a strong undeclared variable)

In order to save your string then it need to be declared as

stringed string_name = “terminate just about all programs”;

Also you can store your string inside a character variety as

char term00 = ‘t’, ‘e’, ‘r’, ‘m’, ‘i’, ‘n’, ‘a’, ‘t’, ‘e’, NO ‘, ‘a’, ‘l’, ‘l’, NO ‘, ‘p’, ‘r’, ‘o’, ‘g’, ‘r’, ‘a’, ‘m’, ‘s’;

To screen this we utilize a loop

for(int i=0; i<term00.time-span; i++)
cout<<termi;

That’s why the altered code may be

incorporate
employing namespace std;

int key ()

char term00;
char end result;
stringed string_name = “terminate just about all programs”;

term00 = ‘a’;
end result = term00;

cout <<"Character is actually "<< result<<"String is usually "<<string_name;

returning 0;

Many thanks, hope that helps

You have become close, it really is something like the following.

#include
#include
employing namespace std;

int main()

stringed term00;
stringed result;

term00 = “terminate all programs”;
end result = term00;

cout << end result;

returning 0;

Leave a Reply