LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 04-20-2011, 06:10 PM   #1
trist007
Member
 
Registered: May 2008
Distribution: Slackware
Posts: 974

Rep: Reputation: 56
I got a question about inserting char arrays into a string...


For example say I have the following code in C.
Code:
char user[32] = "william";
.
.
.
execlp("echo", "echo", "Hello user", NULL);
How would I have william be inserted into user on the execlp line?

Last edited by trist007; 04-20-2011 at 06:14 PM.
 
Old 04-20-2011, 06:21 PM   #2
trist007
Member
 
Registered: May 2008
Distribution: Slackware
Posts: 974

Original Poster
Rep: Reputation: 56
Ah I got it, just inserted it as another argument.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Why is char* a string and not a pointer to a char? el_b Programming 2 09-25-2009 10:33 AM
assigning char arrays calorie712 Programming 3 05-02-2006 12:24 PM
C++ Return Char Arrays (not with pointers) sadarax Programming 4 02-03-2006 04:49 PM
Help needed using char arrays, %s, and if() in C KneeLess Programming 5 08-13-2003 08:42 PM
Comparing Char arrays n_ick2000 Programming 5 02-25-2003 09:02 AM


All times are GMT -5. The time now is 01:49 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration