system() problem

This is a discussion on system() problem within the C++ Programming forums, part of the General Programming Boards category; Hi i am having the same problem this guy had : http://cboard.cprogramming.com/archi...ex.php/t-39262 . In the end the guy said he ...

  1. #1
    Registered User
    Join Date
    Jul 2005
    Posts
    2

    system() problem

    Hi i am having the same problem this guy had : http://cboard.cprogramming.com/archi...ex.php/t-39262 . In the end the guy said he changed to Application, Win32 and he could link the program from c++ without any problem. How can i do that ?

    Thanks in advance,
    Raul

  2. #2
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    When you create a new c++ program, depending on what compiler you are using, you choose File/New and click on the Projects tab. The Projects tab should present you with several choices where you have to tell your compiler what type of program you are going to write. One of the choices is: Win 32 Console Application.
    Last edited by 7stud; 07-30-2005 at 03:32 PM.

  3. #3
    Registered User
    Join Date
    Jul 2005
    Posts
    2
    Sorry i didin't quite get it. I am using Borland C++ compiler(BCW.EXE but i can use BC.EXE aswell). Can you please guide me thru the hole process please?

  4. #4
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    I'm not familiar with that compiler, but what happens when you click on File/New?

  5. #5
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    You could perhaps try to use the C++ function and header:

    <cstdlib> and std::system

  6. #6
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    ...or you could avoid using system, because it's system-dependant and potentially dangerous...

    what were you trying to do?
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    std::system is portable. Perhaps you mean how it works is system dependent? std::system(NULL) is guranteed to do the same thing on every system atleast.

  8. #8
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    I said it was system-depenant, not non-portable... try using system("PAUSE"); or system("CLS"); (which are the two most common uses as far as I've seen) in linux... and what would you ever need system(NULL) for anyway?

    either way, that doesn't clear up security concerns, and besides, just because it works doesn't mean it should be used.
    Last edited by major_small; 07-31-2005 at 09:37 PM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  9. #9
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    The programs you run with system hardly affect the portability of the function itself.

    If string is a null pointer, the system function determines whether the host environment has acommand processor.

  10. #10
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    no, but they affect the portablity of your code.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem while constructing IP packet and sending using socket() system call
    By cavestine in forum Networking/Device Communication
    Replies: 10
    Last Post: 10-15-2007, 06:49 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 03:51 PM
  3. Problem with system(), execl(), etc. functions
    By nickkrym in forum C Programming
    Replies: 5
    Last Post: 05-12-2007, 09:04 AM
  4. problem installing TURBOC in my system
    By ss12 in forum C++ Programming
    Replies: 3
    Last Post: 03-18-2005, 08:57 AM
  5. Another problem swith my wide system MouseProc
    By darcome in forum Windows Programming
    Replies: 0
    Last Post: 10-03-2002, 01:34 PM

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