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

  • Home
  • SEARCH
  • 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 134113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:33:18+00:00 2026-05-11T06:33:18+00:00

Ok the output is supposed to look like this: ./a 3 4 8 2

  • 0

Ok the output is supposed to look like this:

./a 3 4 8 2   3   4   8   2   

This is what I have so far, but I am lost and can only get the first integer to print (we have to use GetInt, which gets the specified integer in the string):

int main (int argc, char*argv []){      int v;        int i;      i = 1;      v = GetInt(argc, argv, i + 1);       if(argc >= 1){         printf('%d\n', GetInt(argc, argv, i));      }      return 0;   }   
  • 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. 2026-05-11T06:33:19+00:00Added an answer on May 11, 2026 at 6:33 am

    Without actually seeing your implementation of GetInt, something like this (Assumes C90):

    #include <stdio.h>  int GetInt( int argc, char* argv[], int i ) {     /*       * you may want to use sscanf, strtol or other functions,      * but you haven't specified      */     return atoi( argv[i] ); }  int main ( int argc, char* argv[] ) {     int i;     for ( i = 1; i < argc; ++i ) {         printf( '%d\n', GetInt( argc, argv, i ) );     }     return 0; } 

    Returns:

    $ ./a.out 3 4 8 2 3 4 8 2 

    Error checking omitted and such. It is an exercise to you to figure out how to deal with non-decimal arguments.

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

Sidebar

Related Questions

Suppose you have output like this: Word1 Word2 Word3 Word4 Where the number of
Okay, so I need to have the output look like a diamond of asterisks,
I know this is supposed to output what kind of shell I'm using, which
I wrote a program for an assignment which is supposed to print its output
I have a data grid that looks like this <tk:DataGrid ItemsSource={Binding Parents} AutoGenerateColumns=False> <tk:DataGrid.Columns>
I've never noticed this behavior before, but I'm surprised at the output naming conventions
Suppose there is a System A which gives some output. This output is used
The output we get when printing C++ sources from Eclipse is rather ugly. Is
I would like to make several statements that give standard output without seeing newlines
Most data processing can be envisioned as a pipeline of components, the output of

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.