| | |
simple program problem - need help
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 48
Reputation:
Solved Threads: 0
Hello.,
Im learning C online, and one of the examples from the internet is this:
but when im trying to compile it sais
ch5m.c: In function ‘main’:
ch5m.c:9: warning: return type of ‘main’ is not ‘int’
is there an error in the exesize?
Thanx!
Im learning C online, and one of the examples from the internet is this:
C Syntax (Toggle Plain Text)
#include <stdio.h> int CalcVolume (int length, int width, int height); void PrintIt (int vol); void main() { int volume1, volume2; int x = 8, y = 15, z = 20; volume1 = CalcVolume (10, 20, 30); PrintIt (volume1); volume2 = CalcVolume (x, y, z); PrintIt (volume2); } /* end of main */ int CalcVolume (int length, int width, int height) { int vol; vol = length * width * height; return vol; } /* end of CalcVolume */ void PrintIt (int vol) { printf("The volume is: %d\n", vol); }
but when im trying to compile it sais
ch5m.c: In function ‘main’:
ch5m.c:9: warning: return type of ‘main’ is not ‘int’
is there an error in the exesize?
Thanx!
Some C compiler will give you a warning when your main function does not return an integer.
In this case, do the following changes to the main function:
In this case, do the following changes to the main function:
C Syntax (Toggle Plain Text)
int main() { ...... ...... return 0; }
Founder of :
Lexel Technologies Pte Ltd - SMS (TXT) Marketing software solution
My Blogs: Gooner's Sanctuary
Pet Directory and Forum: FurryTale.net
Lexel Technologies Pte Ltd - SMS (TXT) Marketing software solution
My Blogs: Gooner's Sanctuary
Pet Directory and Forum: FurryTale.net
![]() |
Similar Threads
- reversing number problem. (C)
- Simple while loop in c++ (C++)
- I am a girl doing my 1st simple program (C)
- DrawHouse Code Problem (Java)
- simple program tokenizer problem (Java)
Other Threads in the C Forum
- Previous Thread: Creating a table in c
- Next Thread: Counting program executions
Views: 467 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C
#include * .net append array arrays bash binarysearch changingto char character cm copyanyfile copypdffile createprocess() database directory drawing dynamic execv feet fgets file floatingpointvalidation fork function functions getlogicaldrivestrin givemetehcodez global grade graphics gtkwinlinux histogram homework i/o ide include infiniteloop initialization input interest intmain() iso keyboard kilometer lazy license linked linkedlist linux list looping loopinsideloop. lowest matrix meter microsoft mqqueue mysql oddnumber odf open openwebfoundation overwrite pause pdf pointer pointers posix power process program programming pyramidusingturboccodes read recursion recv recvblocked reversing segmentationfault single socket socketprogramming spoonfeeding standard strchr string student suggestions system test testing threads unix urboc user whythiscodecausesegmentationfault win32api windowsapi





