>Hi, when i try to convert int to char with _itoa, dont work in my machine, exist a different way for do this job?
>
>this is my code:
>
>char szFile[12] = "";
>char buffer[33];
>int i = 0;
>_itoa(i,buffer,10);
>lstrcat( szFile, "portlog");
>lstrcat( szFile, buffer);
>lstrcat( szFile, ".dbf");
>//lstrcpy(szFile,szFile);
>AfxMessageBox(szFile);
>
>thanks in advance
>
>Regards
>
>Francisco Morosini
It seemed to work for me. I just created a simple console app, set it to include MFC, and used the code:
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <Afxwin.h>
int main(int argc, char* argv[])
{
char szFile[12] = "";
char buffer[33];
int i = 0;
_itoa(i,buffer,10);
lstrcat( szFile, "portlog");
lstrcat( szFile, buffer);
lstrcat( szFile, ".dbf");
AfxMessageBox(szFile);
return 0;
It displays: portlog0.dbf in a messagebox w/an OK button. What kind of problem are you having?