User Profile

Collapse

Profile Sidebar

Collapse
lye85
lye85
Last Activity: Sep 28 '09, 07:29 PM
Joined: Sep 26 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • lye85
    started a topic problem in struct string
    in C

    problem in struct string

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>


    struct account {
    char AccName[20];
    int Age;
    double AccBalance;
    struct account *Next;
    };

    typedef struct account BankAcc;

    void insert(struct account **headOfList, char *name, int age, double balance);
    int Delete(struct account **headOfList, char *name );
    ...
    See more | Go to post

  • lye85
    replied to problem: string in struct
    in C
    void insert(struct account **headOfList, char *name, int age, double balance) {
    struct account *newPtr;
    struct account *previousPtr;
    struct account *currentPtr;

    newPtr = (account*) malloc(sizeof(a ccount));

    if(newPtr != NULL) {

    newPtr->AccName = (char *)malloc(40 * sizeof(char));
    newPtr->AccName = name;
    newPtr->Age = age;
    newPtr->AccBalance...
    See more | Go to post

    Leave a comment:


  • lye85
    started a topic problem: string in struct
    in C

    problem: string in struct

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>


    struct account {
    char *AccName;
    int Age;
    double AccBalance;
    struct account *Next;
    };

    typedef struct account BankAcc;

    void insert(struct account **headOfList, char *name, int age, double balance);
    //int delete(struct account **headOfList, char *name );
    void...
    See more | Go to post
No activity results to display
Show More
Working...