Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // returns the address of the pointer to field's data
- void* CField::data() const{
- return _fData;
- }
- // sets the address of the field's data
- void CField::data(void* tmp) {
- _fData = tmp;
- }
- // allocates dynamic memory for the C-style null-terminated string at the received address and
- // copies that data into the newly allocated memory
- void CLine::allocateAndCopy(const char* Str){
- alloc = true;
- void* tmp = new char[_maxDatalen + 1];
- data(tmp);
- std::strcpy(*(char**)tmp, Str);
- (*(char**)tmp)[_maxDatalen] = '\0';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement