Originally Posted by
gothpunk
how do I declare system?
It's not a good idea to this with "system()". It's not compatible with all systems etc...
try this:
Code:
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
time_t date=time(NULL);
cout<<"Time is "<<ctime(&date)<<endl;
}
char str[10];
//...
//Reads one string from the file
b_file>> str;
You mean, read ten symbols from the file? Then you must do something like:
Code:
//declaring with one extra symbol (which is reserved for the '\0' element, which MUST terminate all char strings)
char str[11];
//reading ten symbols from file and putting them into our string
b_file.read(str, 10);
//assigning '\0' to the last element to terminate the string
str[10]='\0';
cout<<str<<endl;