Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1.         char* ds_name = (char*)malloc(sizeof(char) * name_size);
  2.         memcpy(ds_name, buffer, name_size);
  3.         //strcpy(ds_name, (const char*)buffer);
  4.  
  5.         int* ds_argTypes = (int*)malloc(type_size);
  6.         memcpy(ds_argTypes, (char*)buffer + name_size, type_size);
  7.         std::cout << ds_argTypes[2] << std::endl;
  8.  
  9.         // works fine with strcpy but memcpy causes ds_argTypes to contain zeroes?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement