Thursday, October 8, 2009

graphs in assignment1



_____________________________________

test9.1 of assignment1:

if *curpos >= fieldlen, *curpos = fieldlen-1;

__________________________________________

test9.2 :

if *offset > length of string, *offset = length of string

____________________________________

test9.3:

if *curpos> length of string, *curpos=length of string









Monday, September 21, 2009

OOP344 Challenge1

assume the integer>0

GetInt(char *strint, int val){

int i, temp = val, len = 1;

//count the length of val
while((val /= 10)>0)
len++;

//write char in array
strint[len] = '\0';
for(i = len-1; i >= 0; i--){
strint[i] = temp % 10 + 48;
temp /= 10;
}
}