online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/****************************************************************************** Utilizzo di Strtok. Questa funzione permette di "spezzare" una stringa in token, in base ad un carattere separatore Ad esempio da "salve mondo" si puรฒ estrarre "salve" e "mondo" a partire dal separatore " " Oppure da "cane,gatto,topo,coniglio" รจ possibile estrarre "cane", "gatto", ecc. a partire da "," Il codice seguente mostra come separare una frase con separatore " " *******************************************************************************/ #include <iostream> #include <string.h> using namespace std; int main() { char line[80]; cout << "Inserisci una riga: "; cin.getline(line, 80); // viene inserita la riga char *token; // il token viene definito come un puntatore a un array di caratteri token = strtok(line, " "); // prima esecuzione while (token != NULL) { // se non nullo si ripete cout << token << endl; token = strtok(NULL, " "); // esecuzioni successive } return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue