C++ string manipulation

Discussion in 'Software' started by Almegan, May 22, 2011.

  1. Almegan

    Almegan Private E-2

    Ok I am lost
    I have to write a function (myFunction) to receive a sentence and a word to search in the sentence. If the word is found i must manipulate the sentence so that the word I search for is moved to the front of the sentence.

    I have declared it as
    void myFunction(char input[],char *search)
    {
    char * strptr = strstr(input,search);
    }

    That is all that works so far. I am also not allowed to use the <string> header. only the <cstring>.

    Any help would be appreciated.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds