inherit
180565
0
Nov 28, 2024 15:15:43 GMT -8
User 180565 is taking donation
I forgot you were a person
10,447
June 2012
keenk
Pink Stars
|
Post by User 180565 is taking donation on Sept 9, 2012 4:40:28 GMT -8
I'm getting a red line on a int here thought i'd take a shot with c and try to learn it.
#include<stdio.h>
int main(void){ int age; int salary; float battingAverage; age=20; salary = 5000; battingAverage= .312 printf("I am %d years old", age); getchar(); }
13 C:\Users\Kenneth\Desktop\c\lessons\var.cpp expected `;' before "printf"
Any idea on why it's not executing? I'm using Dev-C++
|
|
inherit
126477
0
Apr 21, 2023 15:18:52 GMT -8
Shrike
Re-appeared briefly after 6 years only to no doubt disappear again.
1,569
June 2008
shrike
|
Post by Shrike on Sept 9, 2012 4:49:26 GMT -8
You're missing a ; after this line battingAverage= .312
|
|
inherit
180565
0
Nov 28, 2024 15:15:43 GMT -8
User 180565 is taking donation
I forgot you were a person
10,447
June 2012
keenk
Pink Stars
|
Post by User 180565 is taking donation on Sept 9, 2012 4:52:37 GMT -8
facepalm
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Sept 9, 2012 11:44:24 GMT -8
It's also a good practice to put a 0 in front of the decimal so you'd have 0.312.
Also, dev-c++ isn't the greatest IDE. I'd recommend Codeblocks or Visual Studio C++ 2010 Express.
|
|