Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8006551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:32:53+00:00 2026-06-04T17:32:53+00:00

I’m wondering which configuration and settings I can experiment with as I’m learning C

  • 0

I’m wondering which configuration and settings I can experiment with as I’m learning C with Microsofts VS Express 2010 compiler. It works with C files if I just start an empty project and add my .h and .c files. I don’t have to change the mode from C++ to C and I could compile an executable and run it from the command land. Is it possible to from within the IDE launch your project that takes command-line args? If yes, how? I have a modularized program that does heap sorting that takes a list parameter from the command line. I can run it from the command line invoking with command-line args but next time I do this I’d like to launch my program with command-line arguments from within the IDE. Is this possible?

#include <stdio.h>
#include <stdlib.h>

#include "sort.h"


/* argc kommer att innehålla antalet argument på kommandoraden
   argv är en vektor med argc strängar som representerar
   argumenten. Observera att första argumentet, argv[0], är
   programnamnet.
*/
int main(int argc, char *argv[]) {
  int *vector, n, i;

  if(argc > 1) {
    n = argc - 1;
    vector = (int *) malloc(n * sizeof(int));

    for(i = 0; i<n; i++)
      vector[i] = atoi(argv[i+1]);

    sort(vector, n);

    printf("Sorted input: %d", vector[0]);
    for(i = 1; i<n; i++)
      printf(" %d", vector[i]);
    printf("\n");

    free(vector);
    return 0;
  } else {
    fprintf(stderr, "Error: No input arguments.\n");
    printf("This program sorts number on the command line.\n");
    printf("Usage: %s n1 n2 n3 ...\n", argv[0]);

    return 1;
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:32:56+00:00Added an answer on June 4, 2026 at 5:32 pm

    The IDE can launch your program with command-line arguments.

    To add command line arguments:

    1. Right-click on your solution in the Solution Explorer.
    2. Select Configuration Properties->Debugging in the sidebar.
    3. Add the command-line arguments that you’ve been using to the Command Arguments field.

    Furthermore, set breakpoints in your code to halt execution if necessary.

    One more thing: if you click in the Command Arguments
    field, or most of the fields in the Configuration Properties GUI, you’ll get a new dialog with a text area for editing the field. Along with this, you’ll see a Macros>> button that shows you the IDE macros that you can use in many of the configuration fields.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.