CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: I Hate Pointers

Threaded View

  1. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: I Hate Pointers

    Code:
    for (i=*Name.size(); i>0; --i)
    A char* is not the same as a string. A char* doesn't has a size function. A char* is a pointer to a array of characters, nothing more. Use strlen to get the length of your text.

    Code:
    *Reverse=*Reverse+*Name[i];
    'Reverse' points to the first character, and you are taking to content of that character. It should look something like this.
    Code:
    Reverse[j]=Reverse[j]+Name[i];
    j++;
    Code:
     void Write(char Reverse, char Name)
    The 2 vars are char, not char*... also, you aren't use 'name' at all, so why put it there at all.
    Last edited by Skizmo; April 2nd, 2009 at 05:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured