0

i would be plzed that some1 tells me why doesn't my program run?and gives this massege "could not creat process!"

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
struct list {
		  char alph;
		  int freq;
};
struct list a[256];
///////////////////////////////////////////////////////////////
int main(){
		  int j,m,f,k;
		  FILE *fin;
		  char ch;
		  clrscr();
		  fin=fopen("a:test.txt","wt");
		  printf("\n enter characters($ for end):");
			do{
				ch=getchar();
				putc(ch,fin);
			  }while(ch!='$');
		  fclose(fin);
		  fin=fopen("a:test.txt","rt");
		  for(j=0,m=0;j<256;j++)
		  {     f=0;k=0;
					 while((ch=getc(fin))!=EOF)
					 {
						if(ch==j)
						{ f=1;
						  a[m].alph=ch;
						  k++;
						}
					 }
					 if(f==1){
						a[m].freq =k;
						m++;
					 }

					 rewind(fin);
		  }
		  fclose(fin);
		  getch();
			return 0;
}
3
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by Tight_Coder_Ex
0

forgot to say
i'm using win xp and turbo c++ and saved my program with the extension CPP.i compiled my program and it doesn't have any errors!

appreciate your help

0

fin=fopen("a:test.txt","wt");

Perhaps you meant

fin=fopen("a:\\test.txt","wt");

and

fin=fopen("a:\\test.txt","rt");
0

I'm not familiar at all with Turbo C++, but maybe check the settings for the compiled application such as machine, stack, heap etc. It could be one of the parameters required by executable header is incorrect.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.