0
Help me to correct the code or tell the mistakes, pls!!!
8 Antworten
+ 2
This will likely not solve all your problems, because you have many semantical and syntaxical errors, but its a start at least
+ 1
You assigned your C variables with double quotes “ “, char variables only accept one character in ‘ ‘ so you either have to make the variables a type String or make an array of chars with each individual letter
char c = “abcd” is invalid
char c = ‘abcd’ is also invalid
char c = ‘C’ is valid
char[] c = {‘A’, ‘B’, ‘C’} is valid
String c = “abcd” is valid
+ 1
Well, I'll try it later. Thanks ♥️😘
+ 1
Ok. I'll work on my mistakes. Thanks again 😌
+ 1
Salam,
1st :
Remove this header file: <Conio.h>.
The Borland Turbo C++ compiler supports "conio.h," but the GCC compiler doesn't. Beginner C/C++ programmers and some books use this file, but it isn't recommended to use it.
2nd :
Replace gets(s) with fgets(s, 256, stdin).
gets() was deprecated in C++11 and removed from C++14.
Add 'const' in line 17 and 18:
const char *C = ......
const char *c = .....
Replace getch() with getchar().
0
A couple of your issues are your include statements are comments and youre trying to assign a String to a char variable
0
Omg... I'm a beginner in C++. So i can't understand what do u mean when say "to assign a string to a char var." Why not? Can u show me on an example?
0
So, I should do the array like this one char*C[ ]={'A', 'B' .... }; right?