11-21-2002, 02:22 PM | #1 |
Emerald Dragon
Join Date: March 12, 2001
Location: spokane wa usa
Age: 40
Posts: 926
|
I'm working on a c++ assignment and i need a little help. I have to compare two end slots in a char array and work my way in ex. first with last, second with second to last ect., then return wheather all the charecter match or not. I can't figure out how to exactly to do it. I know it has something to do with a loop and an if statement but how how exactly i can't figure out.
__________________
<br /><br />All blades cut, be they made from metal or wood, but the sharpest and deadliest blade is the one of knowledge, and that is the least used.<br />An Archmage of the HADB |
11-21-2002, 03:59 PM | #2 |
Baaz Draconian
Join Date: January 15, 2002
Location: Vaasa, Finland
Age: 42
Posts: 772
|
Sorry, I have no clue, and I spam this just to promote Java. It makes everything so much easier.
__________________
Fell in love with a country girl, morning sunshine<br />She was up from a nether world, just to bust another soul<br />[url]\"http://jarkokson.suddenlaunch.com\" target=\"_blank\">Click!</a> |
11-21-2002, 04:01 PM | #3 |
Emerald Dragon
Join Date: March 12, 2001
Location: spokane wa usa
Age: 40
Posts: 926
|
don't know java, plus this is a c++ class so [img]tongue.gif[/img] its fun and not to hard just time consuming. Less now though that i'm using Visual Basic great program and you can use lots of languages in it.
__________________
<br /><br />All blades cut, be they made from metal or wood, but the sharpest and deadliest blade is the one of knowledge, and that is the least used.<br />An Archmage of the HADB |
11-21-2002, 04:06 PM | #4 |
Harper
Join Date: October 2, 2001
Location: Aberdeen, Scotland
Age: 42
Posts: 4,774
|
code:for(n:=0,m:=len(str)-1;n>m;n++,m--)[/QUOTE]Ye gods but I havent used this stuff in while. That for loop is fairly simple -initialise n and m to the beginning and end of your string, end the loop when n is more than m, each loop increment n and decrement m.
__________________
[img]\"http://www.sighost.us/members/Zvijer/andrewas.gif\" alt=\" - \" /> |
11-21-2002, 04:13 PM | #5 |
Apophis
Join Date: July 10, 2001
Location: By a big blue lake, Canada
Age: 50
Posts: 4,628
|
Andrewas, you really ought to add something like "Official computer expert of IW" or something in your signature! [img]graemlins/thumbsup.gif[/img] BTW andrewas, do you know if I can manually add the acrobat script to Word XP? The one that allows you to convert to PDF without changing printer properties? (I think it´s called acrobat.dot) [img]smile.gif[/img]
__________________
Confuzzled by nature. |
11-21-2002, 08:16 PM | #6 |
Manshoon
Join Date: November 2, 2002
Location: Calgary, Alberta
Age: 37
Posts: 155
|
Is this an assignment to find out if a word is a palindrome? if it is, do NOT compare 1st to last, 2nd to 2nd last, etc. instead, reverse your original string and then compare the two...
__________________
|
11-22-2002, 01:42 AM | #7 |
Emerald Dragon
Join Date: March 12, 2001
Location: spokane wa usa
Age: 40
Posts: 926
|
well i allready did that for on funcition, we need to do it two different ways. Sorry for the late reply i have been of doing things. I'll give it a try andrewas
__________________
<br /><br />All blades cut, be they made from metal or wood, but the sharpest and deadliest blade is the one of knowledge, and that is the least used.<br />An Archmage of the HADB |
11-22-2002, 02:02 AM | #8 |
Emerald Dragon
Join Date: March 12, 2001
Location: spokane wa usa
Age: 40
Posts: 926
|
well here i would post my code here so people could confuse themselves but it says html code error, doesn't allow parenthasis on my o well thank for the help, it works. I knew it would just coudn't figure out how to put it into code thanks.
__________________
<br /><br />All blades cut, be they made from metal or wood, but the sharpest and deadliest blade is the one of knowledge, and that is the least used.<br />An Archmage of the HADB |
11-22-2002, 02:10 AM | #9 |
Dracolisk
Join Date: January 5, 2002
Location: Guantanamo Bay, Cuba
Age: 38
Posts: 6,043
|
well you do know that Java and C++ are cousins...
__________________
[img]\"http://membres.lycos.fr/th8or/ZeroSigForIronworks.gif\" alt=\" - \" /> o.o; |
11-22-2002, 02:16 AM | #10 |
Emerald Dragon
Join Date: March 12, 2001
Location: spokane wa usa
Age: 40
Posts: 926
|
there are lots of simular languages there Death, c++, java, and basicaly any general overall languages are related. They all take the code and encode it into the same basic language, that is how all the .net stuff works you know.
__________________
<br /><br />All blades cut, be they made from metal or wood, but the sharpest and deadliest blade is the one of knowledge, and that is the least used.<br />An Archmage of the HADB |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Another Video Card Question becomes Antivirus Question!!! | Bahamut | General Conversation Archives (11/2000 - 01/2005) | 19 | 12-27-2003 11:40 PM |
One BIZZZARE question and one normal everyday question | Sythe | Baldurs Gate II: Shadows of Amn & Throne of Bhaal | 3 | 09-10-2002 02:44 AM |
Early ch6 question - poss spoiler info in question... | Fljotsdale | Baldurs Gate II Archives | 5 | 03-18-2001 12:33 AM |
Dragon spire crystal question + question about Giant killing for the warriorguild | Malakez | Wizards & Warriors Forum | 4 | 02-20-2001 03:52 PM |
spell lvl question, buying spells question, and role ascension question | Paupa | Wizards & Warriors Forum | 1 | 12-31-2000 04:59 PM |