I am working on getting a string into this function but there are already to many arguments.

char interface[10];
	if (!(in = popen("iwlist %s scan","r"))) /*Need interface string here */
	{
		/*to be added */
	}

I tried to add ",interface" after "r" but it said to many arguments. I also tried adding it in a few other places.

Thanks in advance.

Make the string separately using sprintf or the like.

[edit]Make sure your destination has enough room for the text you want in it.

Worked perfectly. Thank you very much.

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.