Love this site and question about c program names

This is a discussion on Love this site and question about c program names within the C Programming forums, part of the General Programming Boards category; First this is a really great site. I'm just starting in programming and the articles for beginners are very helpful. ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    6

    Love this site and question about c program names

    First this is a really great site. I'm just starting in programming and the articles for beginners are very helpful. Which brings me to my question. I was practicing the multiplication function example from the C tutorial and created more programs to practice functions using addition, subtraction, etc.

    Well, I named my first program (the multiplication one) "function practice.c". The next three programs I named "function practice addition.c", etc. Whenever I hit the "compilie and run" button in Dev-C++ (from bloodshed) for any of the programs it would only run the multiplication program. I tried closing the multiplication program, restarting Dev-C++, and restarting the computer (thinking maybe a memory issue...told you I was just starting!)

    Finally, I renamed my initial multiplication program to "function practice multiplication" and that solved the issue. I guess my question is, why did the name of my program matter?

    I use Dev-C++ on Vista.

  2. #2
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Ehh, not sure what you did wrong with Dev, but I suggest using another IDE. Codeblocks or Eclipse with CDT are a couple of options.

    Dev is no longer updated or maintained and has several issues.

    If you download Codeblocks (which is free) you will probably fall in love with it shortly. It's simply what devc always wanted to be but wasn't .
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    6
    I'll definitely try Codeblocks then. Thanks for the scoop on Dev. (unfortunately I have to keep it around for the time being because my assignments have to compile in Dev)

  4. #4
    The larch
    Join Date
    May 2006
    Posts
    3,573
    DevC++ might be having problems with spaces in filenames. It is probably recommended anyway not to use spaces in filenames, because other tools might also have difficulties with them.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    6
    Thanks for the tip anon. No more spaces in file names then.

    And Codeblocks is like night and day when compared to Dev, wow!

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by darkbrew7 View Post
    First this is a really great site. I'm just starting in programming and the articles for beginners are very helpful. Which brings me to my question. I was practicing the multiplication function example from the C tutorial and created more programs to practice functions using addition, subtraction, etc.

    Well, I named my first program (the multiplication one) "function practice.c". The next three programs I named "function practice addition.c", etc. Whenever I hit the "compilie and run" button in Dev-C++ (from bloodshed) for any of the programs it would only run the multiplication program. I tried closing the multiplication program, restarting Dev-C++, and restarting the computer (thinking maybe a memory issue...told you I was just starting!)

    Finally, I renamed my initial multiplication program to "function practice multiplication" and that solved the issue. I guess my question is, why did the name of my program matter?

    I use Dev-C++ on Vista.
    In most ide's you will need to make a new project for each program. Changing the name of your source code doesn't change the name of the final program.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about something found on this site
    By Dogmasur in forum C Programming
    Replies: 2
    Last Post: 08-30-2008, 06:38 PM
  2. question about a site about C
    By alzar in forum C Programming
    Replies: 2
    Last Post: 01-26-2008, 12:56 AM
  3. Encryption Question about tutorial on this site
    By C++weeeeeeeeeee in forum C++ Programming
    Replies: 1
    Last Post: 05-07-2007, 10:52 PM
  4. Question 26 Answer seems wrong on site quiz
    By Kleid-0 in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2005, 03:03 PM
  5. Program Looping question
    By BIt_toRreNt in forum C++ Programming
    Replies: 5
    Last Post: 02-10-2005, 11:14 PM

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