Sponsored Content
Full Discussion: Help with linked list in C
Top Forums Programming Help with linked list in C Post 302509768 by omega666 on Thursday 31st of March 2011 04:30:45 PM
Old 03-31-2011
ok so now i have
Code:
    client *current, *head=NULL;
    current = add_client("tttttttt", current, client_socket_fd);
    current = add_client("ttttttttt", current, client_socket_fd);
    printf("HERE\n");
    write(1,current->client_name,9);
    printf("\n");
    write(1,current->next->client_name,8);
    printf("\nHERE\n");

i dont understand how i am supposed to use head here
Code:
client *add_client(char *username, client *head, int client_socket_fd) {
    client *current = (client *)malloc(sizeof(client)); 
    current->client_name = username;
    current->client_socket_fd = client_socket_fd;
    current->next = head;
    return current;
}

 

10 More Discussions You Might Find Interesting

1. Programming

Reverse single linked list

Can any one help me in reversing the single linked list and at the same time i want to print the reversed links. (2 Replies)
Discussion started by: dhanamurthy
2 Replies

2. UNIX for Dummies Questions & Answers

List linked files

A perl script that displays the list of files which have multiple links..! ls -l shows number of links in a field. (0 Replies)
Discussion started by: aadi_uni
0 Replies

3. Programming

shared memory with linked list??

is this possible, if so plz please share with me.. Correct English please, not Cyber-/Leetspeak (11 Replies)
Discussion started by: vijay_manpage
11 Replies

4. Programming

I need C++ Code for single linked list

I need C++ Code for single linked list With operations as 1)insert at any position 2)delete any 3)change the data of any position (2 Replies)
Discussion started by: girija
2 Replies

5. Programming

How to check if something exists in linked list in C?

i have a linked list set up like typedef struct client_list { char *client_name; int client_socket_fd; struct client_list *next; } client; client *client_list=NULL; before adding to the list i check if it already exists, only if it does not then i add if (client_list==NULL... (1 Reply)
Discussion started by: omega666
1 Replies

6. Programming

how to check if something exists in a struct linked list?

can someone provide an example of a struct linked list, where it has strings as its values, and then how do I check if a specific string (say called buffer) exists in the list of structs? i dont understand how to make a copy of it to check with this is what i have ... (0 Replies)
Discussion started by: omega666
0 Replies

7. UNIX for Advanced & Expert Users

Unix linked-list placement

Hi, I am programming in kernel, and I want to use a double linked list that holds infos that every process could access and modify THIS list. So, I suppose it is a 'global' variable since every process(thread) can reach it, I am wondering where to put it? by changing some of the kernel files? (1 Reply)
Discussion started by: louisTan
1 Replies

8. Programming

Help with linked list.

#include<stdio.h> #include<stdlib.h> struct LinkedList { int val; struct LinkedList *next; }node; /*Creating a structure variable*/ typedef struct LinkedList Node; Node *start = NULL; int create(int i) { Node *temp = NULL; if (start == NULL) ... (5 Replies)
Discussion started by: prinsh
5 Replies

9. Programming

How to delete the last node in a linked list.?

How to delete the last node in a single linked list given only the pointer to last node ? Head node will not be given. (5 Replies)
Discussion started by: VSSajjan
5 Replies

10. Programming

How to reverse a linked list by traversing only once.?

Program to reverse a linked list by traversing only once. (1 Reply)
Discussion started by: VSSajjan
1 Replies
cdsclient(1m)															     cdsclient(1m)

NAME
cdsclient - A dcecp object that represents a Cell Directory Service client SYNOPSIS
cdsclient disable client_name cdsclient help [operation | -verbose] cdsclient operations cdsclient show client_name DESCRIPTION
The cdsclient object allows some low-level control over a CDS client in the local cell. Use it to disable a running client by shutting it down gracefully and to display a limited set of the attribute and counter information that is currently known to the client. ARGUMENTS
The name of one CDS client running somewhere in the local cell. Specify the client name using one of the formats: /.../cell_name/hosts/host_name/cds-clerk /.:/hosts/host_name/cds-clerk The name of the cdsclient operation for which to display help information. ATTRIBUTES
The number of authentication failures encountered by the client since it started. The number of times the client bypassed the cache when looking for information. The number of times the client used the cache when looking for information. The date-time stamp representing when the current client started. The number of non-read, non-write operations processed by the client since it started. The number of protocol errors encountered by the client since it started. The number of read operations processed by the client since it started. The number of write operations processed by the client since it started. OPERATIONS
cdsclient disable Disables the specified CDS client. The syntax is as follows: cdsclient disable client_name The specified client must be running somewhere in the local cell, and you must have the privileges to access that machine. This operation returns an empty string on success. Privileges Required You must have d (delete), w (write), and c (create) permissions on the namespace entry of the clerk. Example dcecp> cdsclient disable /.:/hosts/blech/cds-clerk dcecp> cdsclient help Returns help information about the cdsclient object and its operations. The syntax is as follows: cdsclient help [operation | -verbose] Options Displays information about the cdsclient object. Used without an argument or option, cdsclient help returns brief information about each cdsclient operation. The optional operation argu- ment is the name of an operation about which you want detailed information. Alternatively, you can use the -verbose option to display detailed information about the cdsclient object itself. Privileges Required No special privileges are needed to use the cdsclient help command. Examples dcecp> cdsclient help disable Disables the specified CDS client. show Returns attribute information about the named CDS client. help Prints a summary of command-line options. operations Returns a list of the valid opera- tions for this command. dcecp> cdsclient operations Returns a list of the operations supported by the cdsclient object. The syntax is as follows: cdsclient operations The list of available operations is in alphabetical order except for help and operations, which are listed last. Privileges Required No special privileges are needed to use the cdsclient operations command. Examples dcecp> cdsclient operations disable show help operations dcecp> cdsclient show Returns attribute information about the specified CDS client. The syntax is as follows: cdsclient show client_name The attributes returned mostly represent counter information, which can be used to help isolate a problems with a CDS client. The order the attributes are returned is fixed within CDS. Privileges Required You must have r (read) permissions on the namespace entry. Example dcecp> cdsclient show /.:/hosts/blech/cds-clerk {Creation_Time 1995-10-11-15:09:45.187-04:00I-----} {Protocol_Errors 0} {Authentica- tion_Failures 0} {Read_Operations 78935} {Cache_Hits 55007} {Cache_Bypasses 23726} {Write_Operations 50} {Miscellaneous_Operations 53} dcecp> RELATED INFORMATION
Commands: cdsadv(1m), dcecp(1m), dcecp_cds(1m). cdsclient(1m)
All times are GMT -4. The time now is 09:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy