-   Linux - General (
-   -   gcc, segmentation fault error (

curious95 11-24-2012 05:18 AM

gcc, segmentation fault error
1 Attachment(s)
When i try to run the binary of the source code attatched i get this error

Enter Item number: 12
Enter Unit price: 12
Enter Purchase date (mm/dd/yyyy) : 12/12/1222
Segmentation fault (core dumped)

I get this error no matter what input i give.

linosaurusroot 11-24-2012 05:32 AM

forgotten & signs in scanf

millgates 11-24-2012 05:33 AM

Your forgetting to reference the variables in scanf. Also, if you want input (or output) with slashes, your FORMAT string should reflect that:


scanf("%d/%d/%d", &month, &day, &year);

curious95 11-24-2012 05:41 AM

I can't believe i forgot that :( thanks :)

All times are GMT -5. The time now is 06:06 AM.