Search:

Type: Posts; User: tictac232434

Search: Search took 0.00 seconds.

  1. Replies
    3
    Views
    2,296

    Could you please explain a little bit in more...

    Could you please explain a little bit in more depth how I would use it? Perhaps an example?
  2. Replies
    3
    Views
    2,296

    String Copy in C++

    Hello, I am trying to do a string copy in C++. I have gotten the first one in my code to work, but the next one that accesses my classes does not work. The string compares however do.



    void...
  3. Replies
    2
    Views
    1,550

    I've narrowed the error down to the...

    I've narrowed the error down to the get_firstName.

    It has to do with the pb[i].cfirstName

    nvm solved....
  4. Replies
    2
    Views
    1,550

    Dynamic Memory Allocation

    I am really close to finishing this project. I just have to fix this final problem. Any help is greatly appreciated. Try compiling this code and adding 2 friends then do option 4 to display all...
  5. Replies
    2
    Views
    751

    Full code. Check out the Delfriend function

    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #define MAX_NAME_LENGTH 40


    typedef struct {
    char cfirstName[MAX_NAME_LENGTH];
    char clastName[MAX_NAME_LENGTH];
    char...
  6. Replies
    2
    Views
    751

    Loops and structures

    I am trying to do a swap. I have to use the -> operator. The purpose of this is to delete a contact in a phonebook. The previously mentioned operator has to be used because it is the easiest way to...
  7. Replies
    11
    Views
    947

    void addfriend(book * pb, int * ptrX, char *...

    void addfriend(book * pb, int * ptrX, char * buff){
    realloc(pb, *ptrX * sizeof(book));




    //if(newBuff==NULL){
    // printf("Error allocating memory\n");
    // ...
  8. Replies
    11
    Views
    947

    #include #include #include...

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




    typedef struct phonebook{
    char * firstName;
    char * lastName;
  9. Replies
    11
    Views
    947

    Good point Tim, I did for my initial structure,...

    Good point Tim, I did for my initial structure, but not for this.


    buff = (char *)malloc(sizeof(char));

    Within my main doesn't seem to work though... any ideas?
  10. Replies
    11
    Views
    947

    realloc help in fucntion

    void addfriend(book * pb, int * ptrX, char * buff);


    main(){

    if(option == 1){addfriend(pb, ptrX, * buff);}

    }
  11. Replies
    7
    Views
    1,879

    I appreciate the help iMalc.

    I appreciate the help iMalc.
  12. Replies
    7
    Views
    1,879

    Its moving the first letters of each name. Is...

    Its moving the first letters of each name. Is there a way to move the full names?
  13. Replies
    7
    Views
    1,879

    I am getting close just need a bit of help... ...

    I am getting close just need a bit of help...



    for(i = 0;i < 10;i++){ for(j = 0; j < 10;j++){
    if(strcmp(str[j], str[j+1])){
    temp = str[j][i];
    ...
  14. Replies
    7
    Views
    1,879

    Sorting strings within an array

    This this is what I have so far. I am trying to sort these name alphabetically. So the output should be "Barney, Dino, Fred, Pebbles, Dino"
    Also I have to use strcmp.



    #include <stdio.h>...
Results 1 to 14 of 14