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 8834789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:06:25+00:00 2026-06-14T09:06:25+00:00

Just a simple problem here: I have a char** argv[] that holds all of

  • 0

Just a simple problem here: I have a char** argv[] that holds all of my arguments…in one of these arguments, I get an integer proceeded by a %

For example:

bg %2

I really just want the integer….is there an easy way to get this?

This is for homework, so I am willing to do some more digging if anyone can prod me in the right direction.

Thanks

  • 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-14T09:06:27+00:00Added an answer on June 14, 2026 at 9:06 am

    Here is one way to do it using atoi:

    for (int i = 0 ; i != argc ; i++) {
        if (argv[i][0] == '%') {
            int num = atoi(&argv[i][1]);
            printf("Got a number: %d\n", num);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm guessing this is a simple problem, but I'm just learning... I have this:
I have a very simple JavaScript/jquery code which won't just work correctly. The problem
I have a problem, i have a query that just simply displays the user
I have a simple problem; Here is the code : #include<stdio.h> main(){ int input;
Maybe this is a simple problem, but I am just not seeing it :)
I think it is a fairly simple problem, but I just cant wrap my
I've created a simple class and got a little problem: I just want to
Just a simple question, but can't get an answer on my own. In memory
I am writing a simple console application in Objective-C but I have heard that
So here I believe I have a small buffer overflow problem I found when

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.