Re: Abnormal program termination
- From: "Lew Pitcher" <lpitcher@xxxxxxxxxxxx>
- Date: 1 Sep 2006 06:17:08 -0700
ehabaziz2001@xxxxxxxxx wrote:
I am facing that error message with no idea WHY the reason ? "Abnormal
program termination"
E:\programs\c_lang\iti01\tc201\ch06\own> arr01o01
Enter a number : 25
More numbers (y/n)? y
Enter a number : 30
More numbers (y/n)? n
25.000000
30.000000
The average is 27.500000
Abnormal program termination
E:\programs\c_lang\iti01\tc201\ch06\own>type arr01o01.c
/*#include <stdio.h>
/*-exercise 6.1.1 - calculate average of a series of numbers*/
main ()
{
float number[100];
int no_numbers,i;
float ave(),average;
input_nos(&no_numbers,number);
average=ave(no_numbers,number);
print_nos(number,no_numbers,average);
}
Repeat after me: "main() returns an int, so we must supply an int for
it to return."
What happens if you /don't/ return an int out of main()?
Well, "Abnormal program termination" is one possible answer.
[snip]
HTH
--
Lew Pitcher
.
- References:
- Abnormal program termination
- From: ehabaziz2001
- Abnormal program termination
- Prev by Date: Re: Redirection issue
- Next by Date: Re: General method for dynamically allocating memory for a string
- Previous by thread: Re: Abnormal program termination
- Next by thread: Re: Abnormal program termination
- Index(es):
Relevant Pages
|