Problem on acquiring arguments with asterisk '*' (C language)

Hi everybody, I wrote a simple C programm on Unix (HP-UX). Initially, it has to acquire some arguments by command line and
print them on video. I use:

printf("%s\n",argv[i]);

where 'i' represents the numner of arguments in a 'for' cycle.

Problems begin when I pass a parameter containing '*' character, like this:

ab*1234*

the programm return me this sentence: "No match."

After acquiring, these arguments would be passed to a system call so i need to load these as i write them (with asterisks).

Someone can help me ?

thanks a lot.
Alex.

If you're feeding *something* into your C program as a raw argument without any shell expansion, that's not going to work, it's the shell's job to expand asterisks for you. (Though if you put them in the system() command, they will expand there because system() runs the commands you give it in a shell.) If you're doing that in the shell, I don't know why it's not expanding, and certainly can't tell without seeing your programs (shell and C).

That just means that there are no files in the current directory that match that criteria...otherwise the shell would have expanded the * before passing it to your program...and if you need to pass the arguments as is then you need to put them in quotes to prevent the shell from expanding them. The error mesage is certainly weird...thogh i think it is one that you put in yourself...but then again it is hard to say without looking at your program.

What system call are we talking about...just to make sure im not confusing it with the system lib call that issues a shell command.

Thanks so much.i understand.i have to manage * by shell script and so i can pass the arguments to C programm.
As you said,I think it's the best way.
I'll try.
Thank you for your full explanation.
Alex