Quantcast
Channel: All LoadRunner Practitioners Forum posts
Viewing all articles
Browse latest Browse all 12134

Re: How to read content from a file and storing it in a string variable?

$
0
0

>char buffer[4096]="";

 

There is no need to initialize all 4K bytes with Nuls.

 

>length = fread(buffer, sizeof(char), 4096, fp);

 

Instead of hardcoding 4096, just use: sizeof(buffer)

(Provided it isn't a pointer.)


Viewing all articles
Browse latest Browse all 12134

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>