C
childtobe
I want to write the time to a file. (to implement this in an other
piece of code that i've writen)
For some reason he gives me a C2064 error when i try to put the time
into a string.
As you can see in the code i CAN write it to the screen, but not to a
string...
Any ideas?
(I'm not an expert in c++ so please keep it as simple as possible
)
thanks,
CODE:
#include "stdafx.h"
#include <time.h>
#include <Windows.h>
#include <stdio.h>
#include <string>
char main()
{
SYSTEMTIME st;
GetSystemTime(&st);
char _Datum [11];
char _Tijd[6];
printf("%d-%d-%d " ,st.wYear,st.wMonth,st.wDay);
printf("%d:%d\n" ,st.wHour,st.wMinute);
_Datum("%d-%d-%d " ,st.wYear,st.wMonth,st.wDay);
// error c2064: term does not evaluate to a
function using 4 arguments
_Tijd("%d:%d\n" ,st.wHour,st.wMinute);
// error c2064: term does not evaluate to a function
using 4 arguments
FILE *fp = fopen("test.txt","a");
fwrite(_Datum,1,11,fp);
fwrite(_Tijd,1,6,fp);
fclose(fp);
return 0;
}
piece of code that i've writen)
For some reason he gives me a C2064 error when i try to put the time
into a string.
As you can see in the code i CAN write it to the screen, but not to a
string...
Any ideas?
(I'm not an expert in c++ so please keep it as simple as possible
thanks,
CODE:
#include "stdafx.h"
#include <time.h>
#include <Windows.h>
#include <stdio.h>
#include <string>
char main()
{
SYSTEMTIME st;
GetSystemTime(&st);
char _Datum [11];
char _Tijd[6];
printf("%d-%d-%d " ,st.wYear,st.wMonth,st.wDay);
printf("%d:%d\n" ,st.wHour,st.wMinute);
_Datum("%d-%d-%d " ,st.wYear,st.wMonth,st.wDay);
// error c2064: term does not evaluate to a
function using 4 arguments
_Tijd("%d:%d\n" ,st.wHour,st.wMinute);
// error c2064: term does not evaluate to a function
using 4 arguments
FILE *fp = fopen("test.txt","a");
fwrite(_Datum,1,11,fp);
fwrite(_Tijd,1,6,fp);
fclose(fp);
return 0;
}