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

Thread: type transfer

  1. #1
    Join Date
    Aug 2001
    Location
    New Orleans, Louisiana
    Posts
    98

    type transfer

    In C++ can you go from a larger type to a smaller type. Example

    long lg;
    int in;

    lg = 89;
    in = lg;

    Is this legal or will the compiler give an error????


  2. #2
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    Re: type transfer

    no. and on Windows int is the same size as long. But you may get a warning when it is shorter.


    The best things come to those who rate

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