View Single Post
Old 10-29-2006, 08:03 AM   #12 (permalink)
neeven
Recruit
 
Join Date: Oct 2006
Posts: 7
neeven is on a distinguished road
redhead: can you explain me what each line of the code does plz...im having problems undestandin 'em
Code:
while(1)
    {
      printf ("Enter the string (quit to quit): " ) ;
      fgets( name, INPUT, stdin ) ;
      if(!strncmp(name, "quit", 4))
	break;
      for(i=0; i < strlen( name ); ++i )
	for(j=0; j < length; ++j)
	  if (name[i] == accepted[j])
	    {
	      name[i] = accepted[(j+1)%length];
	      break;
	    }
      printf ( "Transformed string: %s\n ", name) ;
    }
  return 0;
neeven is offline   Reply With Quote