Isn't once we use open(..) function to open the ifstream file will automatically place the file pointer to the beginning?
ifstream inF("file.dat", ios::in | ios::binary);
for (;;) {
inF.read((char *)&num, sizeof(int));
if (inF.gcount() == 0)
break;
cout << num << endl;
}...
I still cannot get the answer. The problem is, the string size can only be known at runtime, otherwise I can just use the character array (fixed size) to eliminate all the problem. But doing that way will waste up space in the file.
Most of the time i need to view about 4 application windows simultaneously, but a single monitor makes uncomfortable for this usage. I'm not afford to buy another computer (CPU..) but another monitor
Is it possible to use more than 1 monitor with a single computer (CPU, motherboard)?
I wanna write a program that storing the following struct of data into the binary file:
struct staff {
string id; // maximum 8 characters.
string name; // maximum 35 characters.
string ic; // identity card number, maximum 14 character.
unsigned short age;
string remark; // no...
I have a excel files which locked by my colleague with password, which prevent me to open it, how to break for password, or is there any alternative way?
Normally the file deleted in Windows just away from sight, the storage still occupied for the deleted file.
How can we make sure that the file is absolutely deleted (impossible to recover) and save space?
Is there any other way to get it? It produce double jobs, because the picture pasted is only value, after i amend the original data i still have to paste the updated data to desire location..
I saw someone created a report which, in a single page, he can make several tables with the different width and number of cell in a table.
Such as table one, 4 columns, each column's width is 4.57, Another table has 7 columns, each columns's width is 6.23, etc.
How to combine tables with...
I tried to use the workspace to minimise the time to open all the source and destination
workbook to make it looks good. But another problem found, the size and order etc of the
workbooks won't be saved every time i save the workspace. And I've set the split and freeze
panes in the worksheets...
I've a workbook that link to other workbook in a formula. When i open the destination
workbook without opening the source workbook the result of the formula is #value!.
It looks correct if both the source and destination files are opened at the same time.
Every time power failure occurs, the Bios halt at the error message screen saying:-
BIOS V4.0
0061 CPU Clock Mismatch
0072 CMOS Checksum Error
0006 Equipment Configuration Error
Press Ctrl_Alt_Esc key to enter Setup or F1 to continue...
What's wrong?
normally when the taskbar is in default size at the bottom, it'll only shows the time and other items.
when i resize it the make it heighter, the day of the week shown, how can i hide that day of the week? i just need the time?
Can't initialize the variable a, why:
#include <iostream>
using namespace std;
typedef struct {
string a, b;
int c;
} T;
int main() {
T a = {"a", "b", 5};
}
The following error & warning messages appear:
Error E2291 test.cpp 11: } expected in function main()
Error E2034 test.cpp 11...
When I use the blink from conio.h, the text doesn't blink, even after I switched it into full screen.
If I run from command prompt in Windows XP, I've to open and closed instantly to make the blink text blinking. Why it doesn't blink all the time in full screen, how to get it work?
I'm using the following to send output to printer:
FILE *prn = fopen("LPT1", "w");
fprintf(prn, "Line 1...");...
How to change the font tyre and size for the output? Thanks.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.