|
|
#1 |
|
Basic C Programming Question - Can anyone help?
This is part of my code:
Code:
int main(){
char str[100];
char min[100];
char max[100];
int count;
int num = 0;
scanf("%i", count);
I'm reading in data from a file with this data: Code:
7 jones smith aki ren stimpy bart Simpson
__________________
New: Nexus 4 16GB iPhone 5 16GB Black & Slate; iMac 27" 2009; Canon Digital Rebel XT(Silver)!; 2012 MacBook Air 13" 1.8GHz Core i5 w/ 4GB RAM, 128GB SSD Last edited by balamw; Feb 6, 2013 at 12:16 PM. Reason: QUOTE->CODE |
|
|
|
0
|
|
|
#2 |
|
You need to give scanf the address of an int so scanf can set its value. Pass &count rather than count.
-Lee |
|
|
|
0
|
|
|
#3 |
|
Wow...I feel really stupid right now. Thanks for the help!
__________________
New: Nexus 4 16GB iPhone 5 16GB Black & Slate; iMac 27" 2009; Canon Digital Rebel XT(Silver)!; 2012 MacBook Air 13" 1.8GHz Core i5 w/ 4GB RAM, 128GB SSD |
|
|
|
0
|
|
|
#4 |
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 10:43 AM.








Linear Mode
