473,406 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

simple quiery on strings

Sir please consider the following...
char a[]="copy mart1.c mart2.c";
Sir I would like to parse the above string using strtok() function...I need to store the individual parsed strings(copy,mart1.c,mart2.c) in a array of strings...
How can I declare that array of strings....Can I do as following..
char *const argv[3];
and store as below..
argv[0]=copy;
argv[1]=mart1.c;
argv[2]=mart2.c;
Thank you...
May 4 '07 #1
2 1193
gpraghuram
1,275 Expert 1GB
HI,
u cant store it directly like that.
You have to allocate memory for each index and then copy the value to it..

Thanks
Raghuram
May 4 '07 #2
AdrianH
1,251 Expert 1GB
Hi martin_paul,

If you want to know how to use strtok() try following this link.

If you have any other questions, feel free to post again.


Adrian
May 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: drs | last post by:
Hi, I am trying to find all lists of length x with elements a, b, and c. To this end, I have created the class below, but it is not quite working and I am having trouble figuring out what to...
4
by: Seth | last post by:
I want to create a simple hash function that can hash strings. Currently I'm storing passwords as strings in a DB but want to store them as a hash. I don't need any proper standardised hashing e.g....
7
by: news.hku.hk | last post by:
is there any way to make a loop to store strings?? e.g. abc.txt contains 3 lines i.e. this is line 1. this is line 2. this is line 3. i want to create a loop that can make the three strings...
9
by: Rafi Kfir | last post by:
Hi, This may look as a smiple task to most of you, but to me (a beginner with C), it drives me crazy. All I want is that one function passes a two dimensional array of strings to another...
3
by: M O J O | last post by:
Hi, A simple question... This is just an example ... Say I have a class (MyClass) that has only few variables (let's say 10 strings) but many-many-many subs and fuctions, so many subs and...
2
by: project | last post by:
anybody can tell me how to find how many days in a month by using sql quiery Posted Via Usenet.com Premium Usenet Newsgroup Services ----------------------------------------------------------...
2
by: jward448 | last post by:
Hello All, I have to write a procedure that does the following: - Connect to a TCP port on a remote computer that has a simple listener application already installed. - Send a series of...
24
by: Michael | last post by:
Hi, I am trying to pass a function an array of strings, but I am having trouble getting the indexing to index the strings rather than the individual characters of one of the strings. I have...
1
by: =?ISO-8859-1?Q?Tor_Erik_S=F8nvisen?= | last post by:
Hi, A while ago I asked a question on the list about a simple eval function, capable of eval'ing simple python constructs (tuples, dicts, lists, strings, numbers etc) in a secure manner:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.