This is highly system dependent and it is unlikely, even if we knew your system, that a 'simple example' would present itself without a significant amount of work.
I'd suggest you google for I/O optimization for your particular platform.
No, you elaborate first. What kind of I/O? Are you doing type conversions like scanf and printf? Do you know about the unformatted I/O functions? Have you profiled your code and confirmed that C's standard I/O is too slow?
I was meaning to know the buffer I/O method and yeah i have some knowledge of unformatted
methods like gets and puts .
And i havent confirmed but got to know from some sites that standard I/O methods are slower than buffer I/O methods(and method wasn't explained on those sites) as faster I/O methods are required for some competitions where run time allowed is 2-3 sec for 10^6 integer inputs .
Can you specify what you mean by "buffer I/O method"? The standard I/O streams are buffered by default for performance. You can adjust the buffering amount to suit your needs, or even turn it off. Presumably the sites you were reading were talking about using system functions instead of standard C functions, such as POSIX's read() or Windows' ReadFile(). These can potentially be faster, or not, depending on many factors and require thorough testing.
I would guess he means "formatted I/O" instead of buffered I/O. Which would be fprintf/fscanf.
Basically the functions that try to interpret the data that's read to some specific type.
I never tried in C/C++ but in Java it was quite clear that ObjectInputStream.readInt() is much slower than FileInputStream.read().
If I'm wrong Narue's post gives teh correct answer.
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.