Should this piece of code work?
void main(void){ char *p; scanf ("%s", p); printf ("%s", p);}
Im sure i remember using character pointers to hold strings this way, but my mind has gone blank today
void main(void){ char *p; scanf ("%s", p); printf ("%s", p);}
#include <iostream.h>void main(){ double average[10]; char names[10][50]; for (int count=0; count < 10; count++) { cout << "Enter name " << count << endl; cin >> names[count]; cout << "Enter average " << count << endl; cin >> average[count]; } for (int i=0; i<10; i++) { cout << names<i> << " " << average[i] << endl; }
quote:
Should this piece of code work?
void main(void)
{
char *p;
scanf ("%s", p);
printf ("%s", p);
}