0
Help me to correct the code or tell the mistakes, pls!!!
8 Respostas
+ 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?