User Profile
Collapse
-
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! -
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;
Leave a comment:
-
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.Leave a comment:
-
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();
Leave a comment:
-
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... -
-
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);
Code:int mainMenu() { char choice; printf("a.
Leave a comment:
-
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...
No activity results to display
Show More
Leave a comment: