Hello,
I'm trying to compile the following program with Visual C++2008.
Pressing F7 compiles without errors.
Afte pressing F5 I'm receiving the following errors:
'process.exe': Loaded 'D:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\process\_CRT_SECURE_NO_WARNINGS\process.exe', Symbols loaded.
'process.exe': Loaded 'D:\WINDOWS\system32\ntdll.dll'
'process.exe': Loaded 'D:\WINDOWS\system32\kernel32.dll'
The program '[2344] process.exe: Native' has exited with code 0 (0x0).
How do I resolve this problem?
Thank you.
I'm trying to compile the following program with Visual C++2008.
Pressing F7 compiles without errors.
Code:
/*Filename process.c : Defines the entry point for the console application.*/
#include "stdafx.h"
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
void process_file(FILE *fp);
int main(void)
{
FILE *fp = fopen("test.txt", "r");
if(fp)
{
process_file(fp);
fclose(fp);
}
else
{
perror("error opening the file");
}
return 0;
}
/********************************************************************/
void process_file(FILE *fp)
{
int ch;
int nalpha = 0;
int ndigit = 0;
int npunct = 0;
int nspace = 0;
while((ch= fgetc(fp)) != EOF)
{
if(isalpha(ch))
{
++nalpha;
}else if(isdigit(ch))
{
++ndigit;
}else if(ispunct(ch))
{
++npunct;
}else if(isspace(ch))
{
++nspace;
}
}
printf("alphabetic characters: %d\n", nalpha);
printf("digit characters: %d\n", ndigit);
printf("punctuation characters: %d\n", npunct);
printf("whitespace characters: %d\n", nspace);
}
/******************************************************************/
Afte pressing F5 I'm receiving the following errors:
'process.exe': Loaded 'D:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\process\_CRT_SECURE_NO_WARNINGS\process.exe', Symbols loaded.
'process.exe': Loaded 'D:\WINDOWS\system32\ntdll.dll'
'process.exe': Loaded 'D:\WINDOWS\system32\kernel32.dll'
The program '[2344] process.exe: Native' has exited with code 0 (0x0).
How do I resolve this problem?
Thank you.