![]() |
| | #1 |
| Registered User Join Date: Feb 2010
Posts: 67
| printing out strings Code:
char scores[50], i;
printf("enter name");
scanf("\n%s", scores[i]);
printf("\n%s",scores[i]);
|
| mouse666666 is offline | |
| | #2 |
| C++ Witch Join Date: Oct 2003 Location: Singapore
Posts: 12,459
| Your syntax is fine. What is wrong is that you should pass scores, not scores[i] to scanf and printf. In fact, you should not use i because it has not been initialised.
__________________ C + C++ Compiler: MinGW port of GCC Build + Version Control System: SCons + Bazaar Look up a C/C++ Reference and learn How To Ask Questions The Smart Way |
| laserlight is offline | |
| | #3 |
| Registered User Join Date: Jan 2010 Location: USA, New york
Posts: 123
| i agree with laserlight. |
| UltraKing227 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| printing strings | Tom_Arch | C Programming | 4 | 04-25-2009 03:23 AM |
| printing wide characters to strings... | davo666 | C Programming | 1 | 02-21-2009 12:56 AM |
| printing char* strings | difficult.name | C Programming | 4 | 12-10-2004 07:06 PM |
| printing strings (was similar problem) | weirdbeardmt | C Programming | 5 | 06-01-2004 01:12 PM |
| printing an array of strings | linucksrox | C Programming | 3 | 05-11-2004 03:31 PM |