#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2012
    Posts
    27
    Rep Power
    0

    Unhandled exception at 0x1029984f (msvcr90d.dll) in tempc.exe: 0xC0000005: Access vio


    char c1, c2, c3;
    int i;
    float x;
    double y;
    printf("\n%s\n%s", "Input three characters," "an int, a float and a double");
    scanf("%c%c%c%d%f%lf", &c1, &c2, &c3, &i, &x, &y);
    printf("\nHere 1S the data that you typed in:\n");
    printf("3c%3c%3c%5d%17e%17e\n\n" , c1 , c2 , c3 ,i, x, y) ;
    getch();
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    I think you're missing a % sign in the beginning of your printf() here:
    Code:
    printf("3c%3c%3c%5d%17e%17e\n\n" , c1 , c2 , c3 ,i, x, y) ;
    should be:
    Code:
    printf("%3c%3c%3c%5d%17e%17e\n\n" , c1 , c2 , c3 ,i, x, y) ;
    The missing % could cause stack corruption after printf() returns, which could cause your error message.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo