Lab8 - /* get_str(str,size): setkto0 while1=1 readc...

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

View Full Document Right Arrow Icon
/*   get_str( str, size ):  set k to 0  while 1 == 1  read c  if c ==  \n then                                   break                        if k > size-2 then                                   print error                                   break                        set str[k] to c                        set k to k+1             set str[k] to null character  end  copy_first_name(full_name, first_name):             set k to 0             set length to strlen(full_name)             while k < length                        if full_name[k] == ' ' then                                   break                        set first_name[k] to full_name[k]                        set k to k+1             set first_name[k] to null character  end  reverse_str(str1, str2):             set k to 0             set length to strlen(str1)             while k < length                        set str2[length-k-1] to str1[k]                        set k to k+1  end 
Background image of page 1

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

View Full DocumentRight Arrow Icon
is_same(str1, str2):             set length to strlen(str1)             if strlen(str2) != length 
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

Lab8 - /* get_str(str,size): setkto0 while1=1 readc...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online