Users browsing this thread: 54 Guest(s)
the poop happens world we live in thread 2XXX
I can't explain things very well though Shy

I can give you some non-C code though!

Part 3:
Code:
public void reverseName(name)
{
string newName = "";
for (int i = name.length; i > 0; i--)
{
newName += name[i];
}
return newName;
}

Part 4:
Code:
public void detectSpace(name)
{
for (int i = 0; i > name.length; i++)
{
if (name[i] = " ")
{
return i;
}
}
return null;
}

Part 5 (lazily done b/c i'm tired:
Code:
public void lastNameFirst(name)
{
string firstName = "";
string lastName = "";
int space = detectSpace(name); //This is the previous part!
for (int i = 0; i > space; i++)
{
firstName += name[i];
}
for (int i = space ; i > name.length; i++)
{
lastName += name[i];
}
return lastName + " " + firstName;
}
Thanked by: Gwen


Messages In This Thread
RE: the poop happens world we live in thread 2XXX - by Sengir - 02-17-2012, 01:34 AM
My head hurts. - by Ivyleaf1212 - 03-11-2012, 07:15 PM
RE: My head hurts. - by Gors - 03-11-2012, 07:53 PM

Forum Jump: