Hi!

I'm currently making a HTTP protocol bot, it works somewhat fine with a fixed char array, but once there's a website that exeeds 8k, then it cuts off. If it's less, I get weird nonsenscial symbols... Is there a way to know the length before assiging the data to the array?

Thanks.

No, but one thing you can do is make a linked list of fixed-length strings (like buffers). Just keep adding to the list as data is received. Then when everything is received you can calculate the size needed, allocate the string memory, then concantinate them all together into one big string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.