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;
}

Dani AI

Generated

That error string usually comes from the IDE when it fails to start the compiled program, not from the C runtime. As already hinted, the file-location/drive choice in your program can make things fail at runtime, and as mentioned, IDE/target settings can stop an executable from being launched. The next steps are to determine whether the IDE failed to produce a runnable EXE or whether the OS/IDE is refusing to spawn it.

Try these concrete checks in order:

  • Verify an EXE was actually created: look in the compiler/linker output folder after a full build. If there is no EXE, you compiled but did not link — run the full build/link step inside the IDE.
  • If an EXE exists, run it directly from Explorer or from a command prompt. If it runs outside the IDE, the problem is the IDE run/execute configuration. If it fails outside too, Windows will give a clearer error to act on.
  • Avoid targeting removable/floppy drives or inaccessible paths; put the source/project in a simple writable folder (short path, no spaces) so legacy tools do not choke on long or spaced paths.
  • Check OS/IDE compatibility: 16-bit Turbo-era tools need NTVDM (present on 32-bit Windows XP) and will not run on 64-bit Windows without an emulator.
  • Review IDE project options (output path, target machine, stack/heap) as suggested; incorrect targets or misplaced runtime settings can produce a nonexecutable binary. Temporarily disable security software while testing in case it is blocking execution.

If a minimal test program (no file I/O) runs, the issue is in the file-path or I/O logic. If no program will run from the IDE, reinstall/move the IDE to a short path or consider running Turbo C inside DOSBox or using a modern Windows toolchain (MinGW/Code::Blocks) for smoother behavior.

Recommended Answers

All 3 Replies

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

Member Avatar for Member #27895

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

Perhaps you meant

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

and

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.