Issues while using Dev C++ on Vista

This is a discussion on Issues while using Dev C++ on Vista within the C Programming forums, part of the General Programming Boards category; Hello All, I am using Dev C++ 5.0 to code a C program in Windows Vista.However,whenever I have pointers in ...

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    5

    Issues while using Dev C++ on Vista

    Hello All,
    I am using Dev C++ 5.0 to code a C program in Windows Vista.However,whenever I have pointers in my program the program can't execute.When I try to run the .exe file I get an error that the .exe file has stopped working.However, if the program doesn't have pointers I am able to run the .exe file.I have no idea why this is coming.Any help would be greatly appreciated.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Two possibilities:
    • You have written a broken program.
    • There's something wrong with Dev-C++ specific to pointers.

    I would put the probabilities at 95% for the first and 5% for the second. (There are definitely things wrong with Dev-C++, and I didn't know they even tried to release 5.0 and bloodshed.net no longer exists so I can't check, but I know of nothing specific to pointers.)

    Does this same code work under (say) gcc, VS, code::blocks, etc? Post the code and we'll look at it.

  3. #3
    Epy
    Epy is offline
    Fortran lover Epy's Avatar
    Join Date
    Sep 2009
    Location
    California, USA
    Posts
    995
    Dev-C++ has a very old version of mingw, use Code::Blocks instead

  4. #4
    Registered User
    Join Date
    Mar 2010
    Posts
    5
    Thanks for the replies.I am sorry,the version which I am using is 4.9.9.2
    I have not tried to run the code on any other software.
    Here is the attached code file: charptrex.cpp

  5. #5
    Registered User
    Join Date
    Mar 2010
    Posts
    5
    Also can I run C programs on Code::Blocks or VS? I tried using VC++ but it didn't allow me to write C programs.

  6. #6
    Registered User
    Join Date
    Mar 2010
    Posts
    5
    I tried using Code::Blocks but I am getting the same error when I run the program.Is it in anyway related to VS-2008 installed on my system?

  7. #7
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Visual Studio kinda-sorta has a C compiler in it. They don't really advertise the fact, but if you load up a .c file in a project, and play "God Save the Queen" on the kazoo* while compiling, it will compile it in C.

    Your program compiles-ish. There is a warning when you try to print name: "format argument is not a pointer (arg 2)" because you need to print name, and not *name. When I changed that everything worked most beautifully.

    *This is not actually true. There is a switch you need to flip in the settings, though, I think.

  8. #8
    Registered User
    Join Date
    Jun 2005
    Posts
    6,629
    Quote Originally Posted by tabstop View Post
    Two possibilities:
    • You have written a broken program.
    • There's something wrong with Dev-C++ specific to pointers.

    I would put the probabilities at 95% for the first and 5% for the second.
    In my experience, even including some pre-alpha-release compilers which were not exactly bug free, the probability of the first case would comfortably exceed 99%.

    There is, however, about a 95% chance that a novice programmer will blame the compiler rather than their own developmental coding skills.
    Quote Originally Posted by tabstop View Post
    Your program compiles-ish. There is a warning when you try to print name: "format argument is not a pointer (arg 2)" because you need to print name, and not *name. When I changed that everything worked most beautifully.
    That is the obvious and likely cause of the crash. printf("%s", *name) interprets the value of the first character of name as if it is a pointer to a string.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Sunshine, and read this, this, and this before posting again.

  9. #9
    Registered User
    Join Date
    Mar 2010
    Posts
    5
    Thanks for the replies,I will be more careful in the future.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dev C on WIndows Vista
    By Aclan in forum Windows Programming
    Replies: 3
    Last Post: 12-08-2009, 12:49 PM
  2. corruption, decay, Vista Gateway laptop
    By CodeMonkey in forum Tech Board
    Replies: 5
    Last Post: 06-13-2009, 02:50 PM
  3. Damn ATI!
    By AloneInTheDark in forum Tech Board
    Replies: 48
    Last Post: 02-16-2008, 09:34 PM
  4. Does Dev C++ 4 even work in Vista?
    By asmileguo in forum C++ Programming
    Replies: 14
    Last Post: 02-07-2008, 09:14 AM
  5. First Vista virus
    By mrafcho001 in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 08-11-2005, 11:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21