User Profile

Collapse

Profile Sidebar

Collapse
joem86
joem86
Last Activity: Oct 21 '08, 10:46 PM
Joined: Oct 21 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • joem86
    replied to Problem with c++ getline
    in C
    I've always had troubles with cin.getline. Try the other getline (defined by <string>)

    Code:
    getline(cin, degree);
    I hope this helps!

    Joe
    See more | Go to post

    Leave a comment:


  • joem86
    started a topic reinterpret_cast'ing a byte array
    in C

    reinterpret_cast'ing a byte array

    I figured the subject would get everyone's attention. So when dealing with sockets, you receive an array of unsigned char's, also known as bytes. One way to interpret data from those bytes is to make a class with all your needed fields (or struct, it doesn't matter), and do something like this:

    Code:
    MyClass *translatedData = reinterpret_cast<MyClass*>(&rawBytesReceivedFromSocket);
    Obviously this is not ideal. I...
    See more | Go to post
No activity results to display
Show More
Working...