Computer Programming (10) - Arrays and Strings


administrivia

Web Page - http://www.cs.tau.ac.il/~efif/courses/ComputerProgramming


pointer subtraction


example


example


example


pointer subtraction


pointer-pointer


pointer subtraction


back to our example


what's this supposed to do again?


printStats()


so let's write the function



so what's the function going to do?


our function so far


how would we do those functions?


next


function inputScores


choosing a loop


inputScores using while


inputScores using while


another inputScores


what's a string?


array of char


initializing arrays of char


implied-length initialization


problem


but that's not always true


strings vs. arrays of char


so our initialization should have been


string literals


what are string literals?


so let's check that


printf declaration


const char *


printf argument


using strings


two similar but different strings


comparison


comparison


comparison


comparison


so what's the difference?


but the two are very similar


what else can we do with strings?

lectures prev top next
Maintained by Efi Fogel. Last modified: December 07 2002.