Sending some byte at time

Posted by user1417815 on Stack Overflow See other posts from Stack Overflow or by user1417815
Published on 2012-06-10T21:43:41Z Indexed on 2012/06/10 22:40 UTC
Read the original article Hit count: 140

Filed under:
|
|

I'm trying to figure out way to send some amount of text from the string ech time until it reach the end of the string, example:

const char* the_string = "hello world, i'm happy to meet you all. Let be friends or maybe more, but nothing less"

Output: hello world

Output: , i'm happy to meet you all.

Output: Let be friends or maybe more

Output: , but nothing less

stop: no more bytes to send.

the problem i have searched google, but didn't understand the examples, i spent 4 days trying find a good way, also that sendt 5 bytes at time, but in case there is less, then send them until you are at the end of the string.

please help me out guys, i will accept a C or C++ way, as long it works and well explained.

© Stack Overflow or respective owner

Related posts about c++

Related posts about c