November 26th, 2012, 09:07 AM
Problem with struct
please am new to c... i want t o creat a sructure contains some item but wehen i try to call store alues in the structure variable i get this error ...expected ')' before '.' token
struct student st1;
printf("student name is %s" ,st1.name );
November 26th, 2012, 09:20 AM
Executable statements must be inside a function; executable statements outside of a function are not allowed!
Those five lines of executable code between the declaration of st1 and the main() function are not in a function. Either create a function for them or place them in the main() function.
Use code tags!
You are implicitly declaring main to return int, but then you do not return anything. Declare main as:
and then make the last statement in main():
That tells the operating system that your program ran successfully. If you need to exit the program because an error kept it from running successfully, then return an non-zero value. That is how things work.
November 26th, 2012, 10:01 AM
Originally Posted by dwise1_aol
thankx man.... i really appreciate