• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

"Backwards reader" program

Kreij

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (3.45/day)
Likes
5,524
Location
Cheeseland (Wisconsin, USA)
#26
Here ya go , Alek. Palindrome code for a word or perfect palidrome phrase ...
Code:
string inputString;
bool IsPalindrome = true;

// Get input string however

for (int i = 0; i < intputString.Length(); i++)
{
    if (inputString[i] != inputString[(inputString.Length() - 1) - i]) 
    {
        IsPalindrome == false;
        break;
    }
}

if (!IsPalindrome)
{
   // output the it's not a palindrome
}
else // output that it is a palindrome
:toast:

d.d.d said:
Alek, to me the best way to learn was to think like the compiler.
This is why coders have problems with relationships. The women keep feeding our "compilers" with ambiguous references and we keep getting unhandled exceptions. :laugh:
 
Last edited:
Joined
Dec 2, 2009
Messages
3,257 (1.10/day)
Likes
315
System Name Mercury KM-81
Processor Phenom II x4 B50
Motherboard ASUS M4A89GTD PRO
Cooling Cooler Master Hyper TX3
Memory 6GB Ram (4GBx1 Corsair 2GBx1 Nanya)
Video Card(s) PowerColor AX6770 V2.0
Storage 2TB WD Black, 1TB Hitachi, 500 GB WD Blue
Display(s) Philips 247E-LPH 24" 1920x1080
Case Mercury
Audio Device(s) Integrated Realtek
Power Supply Corsair 750TX
Software Windows 7 64-bit
Benchmark Scores Maybe it is time to benchmark :D
#27
Thanks!
Oh well, in my country, you can find .net developers by microsoft. (fake one)
So C++ is for no job at all. Those who learnt programming languages, went outside
of the town to find a job. Maybe after 20 years, the situation will change.

EDIT: Still, coping and pasting your code on my compiler doesn't work!
Made mods, still doesn't....
 
Last edited:

Kreij

Senior Monkey Moderator
Joined
Feb 6, 2007
Messages
13,817 (3.45/day)
Likes
5,524
Location
Cheeseland (Wisconsin, USA)
#28
I know what you mean. Here in my little community there are zero jobs for any kind of programmers as it's a rural area.
I would have to move to a city to get a coding job ... and I don't want to do that. I love the peace and solitude of the country life.
So I just keep learning and use what I learn to help others instead of to make money.
Probably why I'm broke. :laugh: