Sunday, November 22, 2009

A problem of io_textedit in assignment2

i am doing io_textedit. In the class, it's hard to rearrange the offset of each line. for example, if i press the key of right arrow when the cursor is at the end of one line, all lines should be moved left by 1 character. That means the offset of all lines must be 1. can anyone give me a clue how to do it?

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;
}
}