Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

c++ convert argv[1] to a char array

Status
Not open for further replies.
Code:
main(int argc, char *argv[])
{
 ......
}

Now, the separators for argv are os dependant but typically they are tabs or spaces so

one, two, and three => four strings
one,two, and three => three strings

If you want number parameters you would convert the string into a number using atoi() atof() ...

HTH
Spiros
 
Can you explain your question a different way?

It is just that argv[1] is already a char array.

What is it that you wish to do?

Can you give us an example of your problem?

Mike.
 
well i wrote this fuction that needs a char array to work but just passing argv[2] doesnt work i wont compile i sayes it cannot convert it
 
whats the code?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top