Ed Casas (edc@ece.ubc.ca) Sun, 22 Oct 2000 17:37:10 -0700
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- New Message to:eece485@listhost.ece.ubc.ca
- Reply to:Re: feb 10 '99 midterm question 2
- Next message: Mehran Azimi: "Components for lab #4"
- Previous message: Andrea Nauman: "feb 10 '99 midterm question 2"
Date: Sun, 22 Oct 2000 17:37:10 -0700 From: Ed Casas <edc@ece.ubc.ca> Subject: Re: feb 10 '99 midterm question 2> How does minchar(x,3) return 1? > shouldn't n = 4. (ie doesn't s have 4 characters - > 3,x,1 and 0) If the function thinks n is the number of characters to be tested, it can be passed a smaller value than the actual number of characters in the array with no ``ill effects.'' > if char x[5] = "3x10" why doesn't minchar return 0? minchar(x,4) would indeed return '0' (not 0). > or if 0 in "3x10" is the 0 that shows that the array > is finished, then shouldn't it be char x[4]? The last character in the string above is stored as the ASCII code for the character '0', not as the null character (the value 0) which terminates the string. -- Ed Casas edc@ece.ubc.ca http://casas.ece.ubc.ca +1 604 822-2592
- Next message: Mehran Azimi: "Components for lab #4"
- Previous message: Andrea Nauman: "feb 10 '99 midterm question 2"