Instead of using User input , how can I take an parameter input and convert it to a string, where I can than check for for input values.

char values[17] = "0123456789ABCDEF" ;

char numIn[15];
int num[15];
int ob, nb, i;

Recommended Answers

All 6 Replies

Are you talking about function parameters or command-line parameters?

Your question makes no sense. Please explain in more detail with and example or two.

EXAMPLE :

I have entered a parameter of to 2 arguments 12 , b2
there 12 = argv[1] ;
b2= argv[2];

how i make this into a string so i can run error checks.

It's already in string
int main ( int argc, char *argv[] )

for example if i but if i have a code input parameter as 12 b2 = so 12 base 2
for argv[1]
{
int ob = atoi(argv[1])
char values[17] = "0123456789ABCDEF"; // array used for table lookup
int ob

    how can I make  a for loop to check  for the char values[17]

For WHAT are you checking it?

What is your program actually supposed to do (overall)?
Is it supposed to be a number conversion program -- converting base 10 to other bases?
Is it supposed to convert a given base back to base 10?

...or something else?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.