Thread: do my homework for me..

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    cereal killer dP munky's Avatar
    Join Date
    Nov 2002
    Posts
    655

    drowning in homework

    ha ha, j/k i know everyone hates that!!!

    but....this is a homework related question i posted a week or so ago and have been having a lot of trouble w/this, this is what i have so far w/the help that i've got...PLEASE!!! do NOT do this for me, i dont want that, i know i have to know this stuff and really want genuine help, if youre just gunna tell me to do it myself then just dont post.

    im supposed to use these data structures and the function prototype given to me to create a linked list, this is what i have so far, i've looked at the tutorials n' stuff but im needing more help....i dont understand how im supposed to get things working, i know i'll have to parse through the string passed to me but other than that, the **headPP thing is really getting me? how do i get this linked list in motion
    Code:
    /*************DATA STRUCTURES******************/
    // Encapsulates each entry in the phone book
    struct PhoneEntry
    {
    	// null-terminated string representing student name
    	char *name;
    
    	// null-terminated array representing student phone number
    	// in the format: XXX-XXXX
    	char number[9];
    };
    
    // Represents the structure of the phone book
    struct PhoneBook
    {
    	PhoneEntry data;
    	PhoneBook *next;
    };
    
    
    /****************FUNCTIONS******************/
    void BuildPhoneBook(PhoneBook **headPP, const char *str)
    {
    	PhoneBook *conductor;
    	const char array[1024] = str;
    	int i;
    
    	conductor = *headPP;
    
    	if(conductor != NULL)
    	{
    		while(conductor->next != NULL)
    		{
    			conductor = conductor->next;   
    	    }
    	}
    	
    	if(array = str)
    	{
    		while(i != NULL)
    		{
    			array[i] = str;
    			
    			if(array[i] = ' ')
    			{
    				conductor->data.name = array 
    			}
    			++i;
    		}
    
    	}
    	
    
    }

    sorry this was so long
    Last edited by dP munky; 03-13-2003 at 02:49 AM.
    guns dont kill people, abortion clinics kill people.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Homework
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 11-03-2001, 04:39 PM
  2. Homework
    By kermi3 in forum C Programming
    Replies: 10
    Last Post: 09-27-2001, 04:49 PM
  3. Homework
    By kermi3 in forum Windows Programming
    Replies: 5
    Last Post: 09-15-2001, 11:48 AM
  4. Homework
    By kermi3 in forum C Programming
    Replies: 0
    Last Post: 09-10-2001, 01:26 PM