More than one main... How is that possible?

the argv[1] didn’t work… any idea?

Thank you!

It works for me perfectly. Did you run the proccess with an extra argument, didn’t you?

Wow, my English is getting worse… :unamused: … Forget the ‘didn’t you?’ part of the question

in the example you just use the argv[0]… in my code it works…
but the argv[1] don’t…

I think that this don’t make difference, but I’m creating the thread like this " pthread_create(NULL, NULL, &thread_mdan, (void*)argv); "

thanks…!

Did you run the proccess for example:

./test_thread “Im_argv1” ??

If you don’t give an extra arg to the command line, argv[1] will never exist, and the process will fail…

It should work fine.

Reagrds,
JM

But I’m using QNX Momentics in Windows connected to QNX 6.4 …
it’s not by command line…

Anyway!.. you have to give an extra argument to your proccess when you run it!

You know who does the argv array works, don’t you?.. So, argv[0] is the full name of your proccess, argv[1] is the first argument and so on with argv[2,3…n]…

SO, if you want to print argv[1] you MUST run your proccess with that EXTRA parameter…

Am I clear?

but how and where I put that extra parameter?

Thanks!

God bless…

Yes it’s a command line. In the run session you created you can specify arguments to be passed along. How can you expect argument from main() to be pass down to the thread if there is no argument ???

Seems to me you are trying to do something without understanding what you are actually doing or what need to be done.

Yes, you’re right… hehe

when you say “run session” you mean the “console”/“prompt”?
I don’t know where and how pass these arguments… and I don’t know if they are really necessary…

This is what you said:

If you said that, is because you need them. I think we were talking about this…

Sorry I mean the Launch configuration. You said you were starting the application from the IDE. In the Launch configuration dialog there is a tab where you can specify the arguments.

I don’t know either… Look at what the QNX4 program is suppose to do and understand that, if you can’t understand what it’s doing find help at work . If you can’t find help at work, then the company you work for is in trouble…

I found that “Arguments” in the configuration… is just put in there “blablabla” isn’t?

my chief is on vacation… I’ll do other activity… when he return I ask him.

That’s because I want to be a chief :stuck_out_tongue: