This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Service log: moving text to file

I'm having trouble making service log, which makes .txt file from keil.

I've already made the c code, and it works good for visual studio, but not in Keil.

The function i use to make the .txt log file is "ofstream" and it doesn't seem to be in Keil, but there must be some other function that can build .txt file in Keil?


Plz give me some advice....
Johnny


Here is the C code:

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
ofstream ServiceRapport("c:/ServiceRapport.txt",ios::app );

char navn[30];
cout << "Name: " << endl;
cin >> Name;

char What[300];

cout << "What has happened: " << endl;
cin >> What;

ServiceRapport << endl << "-------------------------------<Service Rapport>--------------------------------" << endl;

ServiceRapport << "Name: " << name << endl;

ServiceRapport << "Date: " << endl;

ServiceRapport << "Rapport Nr: " << endl << endl;

ServiceRapport << "What has happened: " << endl << endl << What << endl;

return 0;
}

Parents
  • "running it on Phillips P89C664"

    OK, so just where exactly do you suppose that this P89C664 is going to create its files??
    Have you attached a hard drive? or some solid-state mass-storage?
    Or what?

    "But which functions in Keil...

    The supported library functions are all detailed in the Manual.

    The Manual also contains a list of those ANSI "standard" functions which are not supported...

Reply
  • "running it on Phillips P89C664"

    OK, so just where exactly do you suppose that this P89C664 is going to create its files??
    Have you attached a hard drive? or some solid-state mass-storage?
    Or what?

    "But which functions in Keil...

    The supported library functions are all detailed in the Manual.

    The Manual also contains a list of those ANSI "standard" functions which are not supported...

Children