User Profile

Collapse

Profile Sidebar

Collapse
roguefeebo
roguefeebo
Last Activity: Apr 30 '07, 10:37 AM
Joined: Apr 18 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • roguefeebo
    replied to Problems with realloc on array of pointers
    in C
    I found my "bigger" problem that was just a malloc on the pointer instead of a struct variable type. I still can't figure out the warning for incompatible pointer types, but it runs for now!
    See more | Go to post

    Leave a comment:


  • roguefeebo
    replied to Problems with realloc on array of pointers
    in C
    I've got a couple more questions at the bottom you may want to read first so you know what you're looking for. I have changed the code a bit from yesterday:
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    struct menuStruct
    {
      char question[100];
      void *menuCommand;
      struct menuStruct *nextMenu;
    }; //end menuStruct
    typedef struct menuStruct *menuStructPtr;
    ...
    See more | Go to post

    Leave a comment:


  • roguefeebo
    replied to Problems with realloc on array of pointers
    in C
    Excellent. I have no idea how I missed it, I guess I was questioning my use of realloc on the array more than looking at the simple stuff.

    I'm trying to research the first error more without luck so far. I'll see if I can find something that explains it pretty well, but feel free to point something to me.
    See more | Go to post

    Leave a comment:


  • roguefeebo
    replied to Problems with realloc on array of pointers
    in C
    Thanks a bunch, that helped a lot!
    Based on your suggestions I changed the code to:

    Code:
    #include <stdio.h>
    #include <stdlib.h>
    
    struct menuStruct
    {
      char question[100];
      void *menuCommand;
      struct menuStruct *nextMenu[];
    }; //end menuStruct
    typedef struct menuStruct *menuStructPtr;
    menuStructPtr searchNameMenu[1];
    
    void searchNameDB_Name();
    ...
    See more | Go to post

    Leave a comment:


  • roguefeebo
    started a topic Problems with realloc on array of pointers
    in C

    Problems with realloc on array of pointers

    I'm very new to programming so be gentle, :(

    Essentially what I would like to do is to have a single function to be able to create a dynamic array of pointers to a struct so that I can have a modular menu system up and running. My menus will have several varying numbers of options. This is the first time I've worked with something like this and just can't get it worked out.

    I've snipped a lot of unnecessary code to...
    See more | Go to post

  • roguefeebo
    replied to Menu Hierarchy in C: avoid stack issues
    in C
    Awesome, this explains a bunch. Thanks a lot!
    See more | Go to post

    Leave a comment:


  • roguefeebo
    replied to Menu Hierarchy in C: avoid stack issues
    in C
    Thanks for the fast response, :) I wasn't sure if the code segments applied to what I was typing before. I'll try to use it more often to make things clearer

    As for the problem, in main I have:

    Code:
          do
          {
             exit = mainMenu();
          } while(exit != 1);
    And mainMenu():

    Code:
    int mainMenu()
    {
    
         char choice;
          
         printf("a.
    ...
    See more | Go to post

    Leave a comment:


  • roguefeebo
    started a topic Menu Hierarchy in C: avoid stack issues
    in C

    Menu Hierarchy in C: avoid stack issues

    Hello everyone, thanks for looking. I'll get right to the point: I'm having problems trying to figure out a hierarchy of menus in C; command-line style.

    Say, for example the program analyzes a file of names/letters to figure out the patterns of letters within the names. The user should be able to do many things with the information such as add names, delete names, and add new letters (a letter is defined as any subset of a group...
    See more | Go to post
No activity results to display
Show More
Working...