View Single Post
Old 01-08-2003, 11:52 PM   PM User | #1
chrismiceli
Regular Coder

 
Join Date: Sep 2002
Location: Louisiana
Posts: 576
Thanks: 0
Thanked 0 Times in 0 Posts
chrismiceli is an unknown quantity at this point
segmentation fault

how come i get segmentation faults on this code
Code:
#include <stdio.h>
#include <stdlib.h>

float bonus(void);

void main() {
        float b;
        printf("Enter a # to be incremented: ");
        b=bonus();
        printf("The incremented is now %.2f",b);
}
float bonus(void) {
        float i;
        scanf("%f",i);
        return(i+1);
}
__________________
DevEdge - MSDN - DevGuru
chrismiceli is offline   Reply With Quote