segmentation fault for the simplest program??
Posted
by capex
on Stack Overflow
See other posts from Stack Overflow
or by capex
Published on 2010-05-06T03:04:05Z
Indexed on
2010/05/06
3:08 UTC
Read the original article
Hit count: 250
c
|segmentation-fault
Hi,
I am just starting out, but this piece of code is giving me a 'segmentation fault' and I can't find out what's wrong with it:
#include<stdio.h>
int main (void) {
int number = 0; int lastDigit = 0;
printf("Enter an integer: "); scanf("%d", number);
number = number*10;
printf("Number times ten is %d.\n", number);
return 0;
}
© Stack Overflow or respective owner