Lecture 08 - Conditionals

Lecture 08 - Conditionals - Announc e m e nts 08 Co ndit io...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
08 Conditionals Oct. 5, 2006 Announcements • Example Code now on web-page • Grades (for clicker quizzes) appearing tonight – clicker problems – be patient • Next week’s labs: – Monday, Holiday – No formal lab material, go to any lab listed on course outline • Assignment 2: Due in less than 6 days, 20 hours. Announcements (cont.) • Extra advising: – Friday (see Help section on web- page) – Next week (in labs) Assignment 2 • Any questions? Review • Saw more functions and scanf. • Saw examples of the importance of remembering when and when not to use & The Exception to a Rule we can define a string as: char my_string[256]; this allows for a string of up to 255 characters + a special end of string marker (more on this later) “%s” reads a word (separated by space or tab or return) printf and scanf for strings never require an &
Image of page 1

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

View Full Document Right Arrow Icon
Example • char name[256]; • int age; • printf( “Enter your name: ” ); • scanf( “%s”, name ); • printf( “Enter your age: ” ); • scanf( “%d”, &age ); Example 2 • e.g. int get_age( ) { int age; printf( “Enter your age: “ ); scanf( “%d”, &age ); return age; } Example 3 • Reading characters: – char a_character;
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern