+ 3
This is Really Crazy!
Why My Code Doesn't Work!? Please Help https://code.sololearn.com/cDlhqQlZ91ZS/?ref=app
13 Antworten
+ 3
But I have rewrite code from scratch @Alex, and removed function prototype. Is this type of error specific to C!?
+ 3
I am using Xiaomi redmi note 4x with Default English Keyboard.
+ 3
SwiftKey keyboard @Alex, according to phone settings.
+ 3
I have changed keyboard to Gboard English US and made some edits to code but still same error!
+ 3
// To Dear Friend @Alex!
#include <stdio.h>
#include <string.h>
void Execute (char*);
int main(int argc , char* argv[])
{
char command[10];
printf("\n Enter Command Via CommandLine! \n \n");
if(argc < 2)
printf("\n ERROR, Not sufficient arguments!");
else
Execute(argv[1]);
printf("\n \n \n COMMAND ---> ");
scanf("%s" , command);
Execute (command);
}
void Execute (char* command)
{
if(!strcmp(command , "Help"))
printf("\n HELP!!!");
else
printf(" \n <%s>: Command Not Found" , command);
}
+ 3
Thanks @M N
But why that happened!? How spaces can be invalid characters!? It's because of Keyboard or something
+ 2
Can you write some lines of code for me so I can cut them and test the spaces? I want to check where this happens.
+ 1
https://www.sololearn.com/discuss/1178787/?ref=app
same reason again
+ 1
No the bug comes from your device. What keyboard are you using? Maybe use another language setting or another keyboard.
+ 1
I tested around a bit and not all of your spaces are encoded wrong. Hard to tell what's the exact problem.
But we know the reason. Have you tried another keyboard?
+ 1
I checked the code and detected that spaces at the start of lines are invalid chars, so removed them and using tab button of the code playground added them again.
the code works now:
https://code.sololearn.com/cv5iDY81cgF8/?ref=app
+ 1
only the spaces at the begining of lines was invalid, other spaces were valid
i think that you use tab key of your keyboard at the start of lines and it has problem, try a very simple code with a line, and test with the tab key of your keyboard and tab key of code playground