Запись в текстовый файл в borland c++ 5.0
#include <windows.h>
#include <conio.h>
#include <iostream>
#include <time.h>
#include <stdio.h>
#include <string.h>
char ch,D='.',VS='!',VP='?',P=' ';
int* ks;
FILE* fp1 = fopen("D:/my_file.txt","r");
FILE* fp2 = fopen("D:/my_file_out.txt","w+");
int main()
{
if(fp1!= NULL)
{
while((ch=getc(fp1))!= EOF)
{
fputc(ch,fp2);
ks=0;
while((ch!=D)&&(ch!=VS)&&(ch!=VP)&&(ch=getc(fp1)))
{ fputc(ch,fp2);
ks++;
}
fputs("(",fp2);
fputc(ks,fp2);
fputs(")",fp2);
cout<<"("<<ks<<")"<<endl;
}
}
else cout<<"oshibka" << endl;
fclose(fp1);
fclose(fp2);
return 0;
}
с таким кодом записывает аски код в скобки.Как записать числом?
int fprintf ( FILE * stream, const char * format, ... );