acutUpdString vs acutNewString

acutUpdString vs acutNewString

Anonymous
Not applicable
729 Views
3 Replies
Message 1 of 4

acutUpdString vs acutNewString

Anonymous
Not applicable

Can anyone point out the differences between these two methods? It seems that they both allocate memory and copy the contents of another string to the new memory location. Which is the preferred method?

 

Mike

0 Likes
Accepted solutions (1)
730 Views
3 Replies
Replies (3)
Message 2 of 4

Alexander.Rivilis
Mentor
Mentor
Accepted solution

From ObjectARX Docs:

 

acutNewString - function (only !!!) allocates a new string of length specified by nNumChars. 

acutUpdString - function makes a copy of the pInput string and sets pOutput to point to the resulting copy. If pOutput is currently pointing to any allocated memory, then that memory is deallocated even if pInput is NULL. 

 

So those function have different usage.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 4

Anonymous
Not applicable

Thanks for the response.

 

When it comes to your development, do you use the AcString class or ACHAR* for member variables? Assuming you create custom objects. Do you find the AcString class buggy? I have found that occasionally I get Chinese characters because something gets corrupted somewhere along the line.

 

Mike

0 Likes
Message 4 of 4

Alexander.Rivilis
Mentor
Mentor

I have not problem with using AcString, but I've used only English/Russian/Ukrainian symbols. 

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes