05/04/09 18:29
frankus89
osservate questo programma (che dovrebbe essere stato scritto in maniera corretta):
questo l'output:
che razza di errore è questo?
#include <iostream> #include <stdio.h> using namespace std; int main() { char stringa [30]; cout<<"stringa: "; gets(stringa); for (int i=0;i<30;i++) //printf("%c",stringa[i]); cout << stringa[i]; return 0;
questo l'output:
boss@linux-gwqn:~/Desktop> g++ prova2.cpp /tmp/ccX2SWet.o: In function `main': prova2.cpp:(.text+0x88): warning: the `gets' function is dangerous and should not be used. boss@linux-gwqn:~/Desktop> ./a.out stringa: prova prova�鄿X�)X�����鄿�
che razza di errore è questo?
aaa