#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <conio.h>
using namespace std;
int main()
{
[...]
printf( "Polecenie: " );
char polecenie[100];
fflush(stdout);
fgets( polecenie, 100, stdin );
if (strstr( polecenie, "ustaw") == polecenie) {
int y = polecenie[6];
int x = polecenie[7];
int nowa_wartosc = polecenie[9];
cout<<"Nie mozna ustawic takiej wartosci ("<<polecenie<<")";
return 0;
}
Wyjście
Polecenie: ustaw A5 5
Nie mozna ustawic takiej wartosci (ustaw A5 5
).
Czy ktoś może wytłumaczyć mi dlaczego drugi nawas ląduje w nowym wierszu?