prova così.
codice:#include <stdio.h> #include <string.h> #include <iostream> using namespace std; int main () { //dichiarazione delle variabili int i; char temp[20]; char *tmp = temp; const char *str ="PROVA DI SCRITTURA"; int lunghezza; lunghezza=strlen(str); cout << "Stringa inserita:\t " << str << endl; cout << "Lunghezza stringa:\t " << lunghezza << endl; while ( *str ) { if ( !isspace ( *str ) ) { *tmp = *str; tmp++; } str++; } *tmp = '\0'; cout << temp << endl; return ( 0 ) ; }