main program

main program - 3 The Main Program A program consists of one...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
3: The Main Program A program consists of one or more functions. There must be exactly one occurrence of main() : int main(int argc, char *argv[]) int main()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Main The main function looks as follows: int main() { the left brace on the same line as the header body body indented to the right } the matching right brace aligned with int
Background image of page 2
main() is an integer function, which returns one of two standard return codes: EXIT_FAILURE EXIT_SUCCESS Main Function
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3: Literal Constants integer : 123 47857587L floating point : 12.66 23478.78899E- 20 character : '\n' 'd' string
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/18/2012 for the course CS 240 taught by Professor Rego during the Fall '08 term at Purdue.

Page1 / 8

main program - 3 The Main Program A program consists of one...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online