Jump to content

  • Log In with Google      Sign In   
  • Create Account


Vytis

Member Since 23 Apr 2014
Offline Last Active May 08 2014 11:13 AM
-----

#5149032 Array Location? (C Programming)

Posted by Vytis on 23 April 2014 - 01:55 PM

You are not incrementing txtPtr to point to next character.

Basically you are converting the same character text_size times. Then searching for it in search array 26 times.

Change 45 line to
txtPtr = random_text + n;

But, there is a better way.
You could use the fact that letters a-z can be converted directly to integer 0-25 using ASCII table.
I leave the rest for You. A hint about debugger is also useful.


PARTNERS