LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-12-2004, 08:32 AM   #1
xxfunkxx
LQ Newbie
 
Registered: Jul 2004
Location: Vienna
Distribution: Debian Sid
Posts: 26

Rep: Reputation: 15
search in char array


Hello!
I need some help on searching parts in a char array
Code:
if (FD_ISSET(imp3out, &read_set)) {
			iln = read(imp3out, output , 8191);
			//current_line = strtok(output, ">>> *"); 
			printf("\t--->counter %d\n", counter);
The outout has this content:

--> queue
Entry(s) : 1/[1024]
Position : 0 <01_Transistor.mp3>
>>> *311.lst
Play mode : Repeat
List view : Tag, then Filename
Memory : 16.53 Kbytes
Entry(s) : 19
Position : 0 <01_Transistor.mp3>
Status : 0.0% played, 0.0% skipped
--> sunday.lst
Play mode : Repeat
List view : Tag, then Filename
Memory : 16.27 Kbytes
Entry(s) : 5
Position : 0 <new_begining.mp3>
Status : 0.0% played, 0.0% skipped

What I need is the names in red and not the blue one.
I tried the function strtok but it didn not worked yet.
Has any one suggestion.
Forget to mention that it is a C Programm

xxfunkkx
 
Old 12-12-2004, 09:28 AM   #2
xxfunkxx
LQ Newbie
 
Registered: Jul 2004
Location: Vienna
Distribution: Debian Sid
Posts: 26

Original Poster
Rep: Reputation: 15
Read my post again and definitly I did not tell much about my problem. I read from a named piped imp3out some status information in the char array output[8192];.

The status information contains the names of mp3 playlists. I need each name for display and selection option.
But I don`t know how to search inside this char array for a specific string.

So I hope I described my problem better than in the previous thread.

xxfunkxx
 
Old 12-12-2004, 11:23 PM   #3
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
Check out the strstr() function.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C# convert char array to string exodist Programming 3 09-16-2008 08:06 AM
problem in copying array to char * monil Programming 15 03-13-2005 04:22 PM
array of char pointers djgerbavore Programming 2 01-08-2005 01:59 PM
char array of size 10 can read morethan 10 chars!!!!! pippet Programming 13 07-12-2004 01:44 AM
Char array to int without losing value ? Dimitris Programming 3 01-14-2004 12:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration