CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: laserlight

Search: Search took 0.07 seconds.

  1. Replies
    19
    Views
    14,837

    Re: return function

    Lindley is taking advantage of something implementation dependent, i.e., it is an attempt to trigger the use of the memory previously allocated to the destroyed array. This attempt happens to work.
    ...
  2. Replies
    19
    Views
    14,837

    Re: return function

    No, the pointer in main() will correctly point to the first character of the string literal. So, in this sense it is much ado about nothing: your code is correct on that point.

    Let's look at an...
  3. Replies
    19
    Views
    14,837

    Re: return function

    No, an array is always convertible to a pointer to its first element, which certainly is not of the same type as the array ;)


    No, what VictorN is saying that by returning a string literal as you...
  4. Replies
    19
    Views
    14,837

    Re: return function

    I had the impression that since a string literal is returned that is not so due to static storage duration. What would be wrong is the return type, i.e., it should be const char* instead of just...
Results 1 to 4 of 4





Click Here to Expand Forum to Full Width

Featured