-
February 16th, 2015, 10:19 PM
#1
displaying reverse of string input value without using any class library fuctiions
Someone please help me write a code which displays reverse of input(string) value without using any class library/builtIn functions.
for example,
String s= reverseString("hello");
//I want to have this "hello" to be print out/output backwards. So we need to create a reverseString's function.
Please help me with the rest, will appreciate it. Thank you.
-
February 16th, 2015, 10:42 PM
#2
Re: displaying reverse of string input value without using any class library fuctiion
Turn the string into a character array, find the length and back your way through the string from the end to the beginning.
When you get this coded, post the homework here if you need more help.
-
February 16th, 2015, 10:58 PM
#3
Re: displaying reverse of string input value without using any class library fuctiion
Thank you, ok so :
String s= reverseString("hello");
string reverse;
int i, j;
String reverseString(string str)
{
char[] c=new char[str.char()];
for(int i=c.length-1, i>-1, i--)
{
reverse=j[i];
return reverse;
}
console.writeline("Reverse of your input string is:" + j[i]);
//I am not sure about this code, do not understand, please help
-
February 16th, 2015, 11:10 PM
#4
Re: displaying reverse of string input value without using any class library fuctiion
Originally Posted by Arjay
Turn the string into a character array, find the length and back your way through the string from the end to the beginning.
When you get this coded, post the homework here if you need more help.
Arjay, I have posted my homework but not sure if I understood properly, the code needs to be improved, please help me in this, thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|