10 More Discussions You Might Find Interesting
1. Programming
I am struggling with the pointer to 2D-array (cf: 2D array of pointers). Can anybody help me elaborate how the pointer x moves in the memory to access the individual of y, especially the high lighted lines?
I have talked to one of the curators of the forum, but I am still not quite clear.
Here... (1 Reply)
Discussion started by: yifangt
1 Replies
2. Shell Programming and Scripting
Hi Community,
Would love to get some quick help on below requirement.
I am trying to process mpstat output from multiple blades of my server
I would like to assign this the output to an array and then use it for post processing. How can I use a two dimensional array and assign these value
... (23 Replies)
Discussion started by: sshark
23 Replies
3. Programming
Hello,
The purpose of the program is to print a sub string from the prompt inputs. I do not understand why char pointer does not work but char array will for line 40 and Line 41.
./a.out thisisatest 0 8
substring = "thisisat"And my code is:
#include <stdio.h>
#include <stdlib.h>
#include... (29 Replies)
Discussion started by: yifangt
29 Replies
4. Programming
I am trying to get userinput from stdin and store the lines in an array.
If i do this:
using a char **list to store strings
allocate memory to it
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv)
{
char *prog = argv;
char **linelist;
int... (5 Replies)
Discussion started by: tornow
5 Replies
5. Shell Programming and Scripting
Respected All,
Kindly help me out.
I have got file listings in a directory like this:
-rw-r--r-- 1 root root 115149 2011-11-17 07:15 file1.stat.log
-rw-r--r-- 1 root root 115149 2011-11-18 08:15 file2.stat.log
-rw-r--r-- 1 root root 115149 2011-11-19 09:15 file3.stat.log
-rw-r--r-- 1... (2 Replies)
Discussion started by: teknokid1
2 Replies
6. Programming
if i create an array of pointers to a structure "struct node" as:
struct node *r;
and create "n" number of "linked lists" and assign it to the various struct pointers r using some function with a return type as structure pointer as:
r=multiplty(.......) /*some parameters*/
is... (2 Replies)
Discussion started by: mscoder
2 Replies
7. Programming
i have an array like
#define NUM 8
....
new_socket_fd = accept(socket_fd, (struct sockaddr *) &cli_addr, &client_length);
char *items = {"one", "two", "three", "four", "five", "six", "seven", "eight"};
char *item_name_length = {"3", "3", "5", "4", "4", "3", "5", "5"};
... (1 Reply)
Discussion started by: omega666
1 Replies
8. Programming
Hi all,
Can anyone provide help with getting the right syntax regarding array/pointers in C in the following code? Can't locate a specific example which clarifies this...
Say I declare a typedef to an array of pointers to some type...
/**
* An array of ptrs to sections
*/
typedef... (4 Replies)
Discussion started by: gorga
4 Replies
9. Shell Programming and Scripting
Hi Guys,
I have a file which is as follows:
1
2
4
6
7
I am trying to store these values in an array in bash. I have the following script:
FILE=try.txt
ARRAY=(`awk '{print}' $FILE`)
echo ${ARRAY} (3 Replies)
Discussion started by: npatwardhan
3 Replies
10. Shell Programming and Scripting
Hi All,
I need some help with arrays. I need to take input from the user for hostname, username and password until he enters .(dot) or any other character and store the values in the variable array.
I would further connect to the hostname using username and passwd and copy files from server to... (7 Replies)
Discussion started by: nua7
7 Replies