This is a discussion on Glad the forum is back... BIG question regarding function pointers and structs... within the C++ Programming forums, part of the General Programming Boards category; I am trying to get this program to work, when it runs, any command, aside from exit causes the function ...

I am trying to get this program to work, when it runs, any command, aside from exit causes the function mylowercase
to run. I have no clue, as I have been looking at this for a few days and I cannot find where the problem is. Any help on this one would be huge.

I suppose its subtle but this is the root of a lot of problems. You set i = to a function and test it to -1. The function correctly returns the value and it does not equal -1 so it evalutes to true ( or 1 in this case ). You need to wrap your assignment in paranthesis to give correct order of precedence. Here ya go.

Code:

if( (i=binary_search_iterative(sh_table,0,table_size-1,comm))!=-1)

Now you have some other problems but that should get you on the right path. If you get stuck again let us know. Enjoy.

"...the results are undefined, and we all know what "undefined" means: it means it works during development, it works during testing, and it blows up in your most important customers' faces." --Scott Meyers

great, thank you so much, i knew it had to be something so small as assignment and order of operations, but I couldn't find it... sometimes it takes another set of eyes to find what is going on... Appreciate it! Thanks!

in the myreversestring function, I'm not sure on the type of loop sturcture to use... obviously the if is not going to cut it, but I thought it would be a place to start, just to see if it prints out the right character... any suggestions?