Why is the size of most input buffers 256 bytes only? Is this dependent on processor or OS? The same program to read string of length more than 256 characters, gives erroneous result on unix and solaris systems. But the same program in VC++ gives correct string length. If the buffer size depends on OS, I cant get the correct result using Turbo C++ on the same Windows platform, where VC++ yielded correct result. Can anyone address this issue and suggest a method to get a string of greater than 256 bytes in one go? (however command line argument in C program can accept more than 256 characters and yield correct result)..
2006-11-22
17:10:23
·
2 answers
·
asked by
Srini
1
in
Computers & Internet
➔ Programming & Design
Why is the size of most input buffers 256 bytes only? Is this dependent on processor or OS? The same program to read string of length more than 256 characters, gives erroneous result on unix and solaris systems. But the same program in VC++ gives correct string length. If the buffer size depends on OS, I cant get the correct result using Turbo C++ on the same Windows platform, where VC++ yielded correct result. Can anyone address this issue and suggest a method to get a string of greater than 256 bytes in one go? (however command line argument in C program can accept more than 256 characters and yield correct result)..
FYI, I used both CC and g++ compilers in unix environment (32-bit), but still didnt get the correct length of string..
2006-11-22
17:27:48 ·
update #1