Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your help!

We need 7 developers from Canada and 18 more from Australia to help us complete a research survey.

Support our site by taking a quick sponsored survey and win a chance at a $50 Amazon gift card. Click here to get started!


#ActualVytis

Posted 23 April 2014 - 02:02 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.

#2Vytis

Posted 23 April 2014 - 02:00 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-26 using ASCII table.
I leave the rest for You. A hint about debugger is also useful.

#1Vytis

Posted 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.

Change 45 line to
txtPtr = random_text + n;

PARTNERS