step by step global/local variable debugging

Posted on 2014-08-15
Last Modified: 2014-08-18

I can run a c file using

visual 2013 express which can be downloaded at

but how can I see global/local variables variables

only thing I can do is run .c file

I would like step by step debugging
please do not recommend eclipse or netbeans because those are different experts exchange questions which I can not get to work
Question by:rgb192
    LVL 31

    Expert Comment

    >> I would like step by step debugging
    >> how can I see global/local variables variables

    Take a look at this article to see if you can follow these steps. If you get stuck on a step, then let me know. Below, I've listed a few keyboard commands that may help you get started even if you do not read the article.

    1. Building Program with Symbolic Debugging
      1.1. Building in Debug Mode
      1.2. Building a C Program
    2. Program Navigation
      2.1. Breakpoints
      2.2. Starting the Program and Hitting Breakpoints
      2.3. Stepping Through the Program
      2.4. Setting the Next Statement to Execute
      2.5. Caveat: Console Interaction with Debugger
    3. Examining and Modifying Variable Values
      3.1. Mouse Hovering Reveals Values and Structure
      3.2. Quick Watch
      3.3. Autos and Locals Tab
      3.4. Modifying a Variable Value
    4. Command Line Arguments
    5. Stopping the debugger

    Summary of Keyboard Commands Used in this Article
    F5   – Start Debugging; or continue Debugging
    F10 – Step over next line
    F11 – Step into function or method
    F9   – Set/Unset Breakpoint

    <Ctrl+Shift+F5> –  Restart Program Debugging
    <Ctrl+Shift+F10> –  Set position of next statement to execute
    LVL 31

    Expert Comment

    After you feel comfortable with the article in my previous post, you may wish to learn more about special features in setting breakpoints to make your debugging experience more productive. If so, read this article:

    1.  Conditional Breakpoints
    2.  Hit Count Breakpoints
    3.  Touch and Go Breakpoints (a.k.a. Tracepoints)
    4.  Exception Breakpoints

      4.1.  Change How the Debugger Handles an Exception
      4.2.   Adding a User Defined Exception
      4.3.   Breaking on a User Defined Exception
    5.  Run To Cursor (Create a Temporary Breakpoint)
    6.  List of Breakpoints

    You may be surprised how easy it is to learn to use the Visual Studio Express debugger.

    Author Comment

    I read the 3 articles and
    I got the debugger working
    how can I be sure I am doing the debugging for c (instead of c++)
    is creating a .c file in the source directory ensure that I am using c debugger
    LVL 31

    Expert Comment

    >> is creating a .c file in the source directory ensure that I am using c debugger
    Yes, provided that all the files in your project have a .c extension (or header extension).
    LVL 31

    Accepted Solution

    By default, CL assumes that files with the .c extension are C source files and files with the .cpp or the .cxx extension are C++ source files.
    The link also explains how to set flags to force the C compiler, but everyone I know simply use .c file extensions and not be concerned about flags.

    Author Closing Comment

    I change project properties
    c++ folder
    compile as c code

    and I will post errors in future questions or stick with just .c filenames which is your other solution

    LVL 31

    Expert Comment

    Your choice as to how to force C-language using VS 2013.
    At the workplace, we have never changed properties. We always use the .c extension for C source. This is a VS quirk. In Linux, you better explicitly pick the right compiler which doesn't care what the extension is.
    LVL 28

    Expert Comment

    I suggest to start with C++ istead of C. (I know I may be fried in a flamewar, but I believe C++11 is better for beginners than the plain C. And you can do everything that you can with C.)

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
    This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
    Video by: Grant
    The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now