-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 19 answers
- 8,273 views
-
- 3 answers
- 9,997 views
-
- 0 replies
- 192 views
-
- 1 answer
- 1,639 views
-
- 0 answers
- 6,037 views
-
Question
Richard Grant
I am converting some code i wrote in C# to C++.
I have programmed a server which works perfectly fine HOWEVER,
When sending data to the client my:
The issue is that if the server sends the string:
"Neowin.net is awesome!" //length is 22
The char size is equal to the buffer_size which means i would be sending 2mb ever time i want to send, when all i really need is 22 bytes
FROM MY UNDERSTANDING i can not use:
I would like to convert the char* to a string and get the length of the string and multiply it by the sizeof(char) to get the sizeof buffer
__
How can i convert a char * to a string?
Link to comment
https://www.neowin.net/forum/topic/1230937-c-char-buffer-sizeof/Share on other sites
3 answers to this question
Recommended Posts