The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help Storing PID Porthos Shell Programming and Scripting 1 04-23-2008 02:41 AM
Storing a variable? hoover90 Shell Programming and Scripting 4 01-26-2008 09:39 PM
far pointer useless79 High Level Programming 1 11-08-2007 05:13 AM
create array holding characters from sring then echo array. rorey_breaker Shell Programming and Scripting 5 09-28-2007 08:42 AM
pointer sarwan High Level Programming 1 11-15-2005 06:41 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-23-2007
arunkumar_mca arunkumar_mca is offline
Registered User
  
 

Join Date: Oct 2004
Posts: 255
Storing pointer array in C

All ..

I am having a pointer array . And trying to store the addess into that pointer array . please see below the problem i faced


code:
int cnt1;
char *t_array[1000];
char *f_array[1000];

for(cnt1=0; cnt1<1000; cnt1++)
{
t_array[cnt1] = buf+(cnt1*6);
f_array[cntl] ="123456789";
}

after that i a looping through an array
cnt1=0;
while (somearray ends)
{
f_array[cnt1] = arrayvalues;
cnt1++;
}

when i print the f_array values like this

printf ("\n **********************************\n");
printf ("\nARRAY F_ARRAY \n ==> %s", f_array[0]);
printf ("\nARRAY F_ARRAY \n ==> %s", f_array[1]);
printf ("\n **********************************\n");

I am getting the last values for all f_array .. I know that f_array is apointer and having the addres of arrayvalues so it is printing the last values ..

Is there some other way so that i need all values of array values to be stored in f_array ??....

With out using double dimensional array.

Thakns,
Arun...
  #2 (permalink)  
Old 08-23-2007
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Arun,
You are posting this in a wrong forum.
People will not look into this as this is not their experties.
There is a another forum for this.

Thanks,
Namish
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:25 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0