Menu

Two Problems with Dev C++

2009-12-07
2012-09-26
  • Mohammad  Arbab

    Mohammad Arbab - 2009-12-07

    Hi,

    I am new to Dev C++ (and C programming iteself!). I was trying to write a
    project in Dev C++ and I faced two problems. I will really appreciate it if
    anyone can help:

    1- I created a project and added one main file to it. There are some functions
    that are called in the main file. These functions are defined in other files
    in the same directory of the main file (I didn't add other files to the
    project). When I modify the fucntions and I run the project, the result is the
    same as before! Nothing happens when I change or even delete one of them, and
    the program is working as if they were unchanged. I am confused with the
    problem.

    2- How can I see the value of the variables that I am using in my program? For
    example in Matlab I can easily see the variable contents after running my
    program. But I could't find anywhere in Dev C++ to see the variables and their
    contents.

    Thanks,
    Mohammad

     
  • cpns

    cpns - 2009-12-07

    I didn't add other files to the project

    If you did not do that, then the program would not have linked - unless that
    is you #include'd those files - which is a really bad idea. My guess is that
    the build is in fact failing, and you are running the last version that built.
    You did not post your code or your build log, so there is not much we can do
    on the information given. Be sure to use code mark-up to post both the code
    and the log (i.e. select the text and click the "code-sample" button above the
    post composer.

    How can I see the value of the
    variables that I am using in my
    program?

    Use the debugger. However be warned the debugger (or rather Dev-C++'s
    integration of GDB) sucks, is buggy, and incomplete. It is hardly worth the
    effort, and is Dev-C++'s most significant flaw. Use VC++ 2008 Express Edition
    instead; it is free, and has the best debugger available.

    For example in Matlab I can easily see
    the variable contents after running my
    program.

    MATLAB is an interpreted language, and is conceptually different than C. For
    example it has no concept of variable scope, and all variables exist within
    the MATLAB environment after a script has executed. In C, the program is a
    binary executable that is loaded and executed by the OS, not by the IDE (even
    if you run it within the IDE); any variables are part of that executable, and
    do not exist within the IDE environment. You can only observe the variable
    values while they are in scope, while the program is running, in the debugger.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.