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

Threaded View

  1. #9
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Using this XOR encryption in C++

    Quote Originally Posted by qwerz View Post
    Uhm yes I see the difference, but I have no idea why it would be dangerous.

    Are you saying that the difference between
    char p[] and char *p is that char p[] is really a char array while the first one is a string-literal and not writable?
    Yes. Why not try the small program and see what happens? Depending on the compiler you're using, the code that uses the string-literal will immediately crash on the assignment to p[0].

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; June 4th, 2012 at 09:14 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