Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9197197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:01:09+00:00 2026-06-17T22:01:09+00:00

I am working on a small homework program with C, and I encountered a

  • 0

I am working on a small homework program with C, and I encountered a very unusual issue. I was coding this in C using Visual Studio 2012. The program compiles without errors, and it also runs in cmd until a certain stage where it crashes with an exception. Please ignore the logic of the program, I cut some parts to focus on the error itself. I would really appreciate some help on this. Thank You!

Here is the program:

#include <stdio.h>
#include <math.h>

int main( void )
{
    int menuinput;
    int austinHour, austinMinute;
    int irishHour, irishMinute;
        printf("Insert a Number from 1-11 to select menu option: ");
        scanf_s("%d",&menuinput);
        switch(menuinput)
        {
            case 1:
            { 
                irishHour=0;
                irishMinute=0;
                austinHour=0;
                austinMinute =0; 
                printf("Enter Austin time: ");
                scanf_s("%d %d",austinHour,austinMinute);
                irishHour = (austinHour + 61);
                printf("%d %d",irishHour, austinMinute);
            }
                }

The error is the following when I try to run the program:

First-chance exception at 0x62ACD745 (msvcr110d.dll) in Lab2.exe: 0xC0000005: Access violation writing location 0x00000000.

If there is a handler for this exception, the program may be safely continued.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:01:10+00:00Added an answer on June 17, 2026 at 10:01 pm

    You have an typo, You did not pass the address of arguments in scanf:

     printf("Enter Austin time: ");
     scanf_s("%d %d",&austinHour,&austinMinute);
                     ^^          ^^
    

    And I say it is an typo because you did so correctly the fist time you use scanf:

    scanf_s("%d",&menuinput);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I'm working on a small program in C (again, not a homework task,
The Background I am currently working on small MIPS program for a homework assignment,
I'm working on a small homework assignment and I'm supposed to make a food
is there any small working program for recieving from and sending data to client
I'm a LAMP guy and ended up working this small news module for an
Working on a small game using an HTML5 canvas, and javascript. And it's working
I'm working on a small uni project where I have a program for a
I'm working a small qt app (using PyQt4) and I've come up with an
Having some issues with one small function I'm working on for a homework assignment.
I am new to Yii framework, in this i am working on small project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.