Search:

Type: Posts; User: JamesD

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    4,084

    Thanks anduril462 I will find out what I can, as...

    Thanks anduril462 I will find out what I can, as that would be really useful to have.
  2. Replies
    7
    Views
    4,084

    It was the break; ahah, not sure how I missed...

    It was the break; ahah, not sure how I missed that one, and to be more specific its UNIX, when I entered man cc I got this, its beyond me..:



    Last login: Wed Mar 30 16:55:31 2011 from...
  3. Replies
    7
    Views
    4,084

    Mine just had whitespace warnings for lines 1-4...

    Mine just had whitespace warnings for lines 1-4 lol(I have no idea what that means btw), The compiler I use is called SSH(Secure Shell) If anyone knows how to upgrade to maximum warnings that would...
  4. Replies
    7
    Views
    4,084

    Searching Linked List

    I am having trouble searching a Linked List for contacts, when the program goes to scan in the last name it reads it in over and over. I am wondering why it doesn't just take the name and continue...
  5. Replies
    10
    Views
    1,529

    Got it working, thanks for the help.

    Got it working, thanks for the help.
  6. Replies
    10
    Views
    1,529

    This accounts for ptrFirst and doesn't re-write...

    This accounts for ptrFirst and doesn't re-write ptrNew over and over, however it fails to bring up any results either.. And I'm not sure why


    int Load(const char* filename)
    {
    FILE* infile;...
  7. Replies
    10
    Views
    1,529

    I looked up putting a whole struct to a file, and...

    I looked up putting a whole struct to a file, and tried it out in my program and got this:


    int Save(const char* filename)
    {
    FILE* outfile;
    int count = 0; // how many records saved
    struct...
  8. Replies
    10
    Views
    1,529

    Its just basic stuff, ex input: 1 2 point1 8...

    Its just basic stuff, ex input:
    1
    2
    point1
    8
    9
    point2
    12
    34
    point3
  9. Replies
    10
    Views
    1,529

    Dynamic Memory and Files

    I am making a program using dynamic memory and was able to successfully code it going into the file, but need help reading it back, I am stuck in the function Load.


    #include <stdlib.h>
    #include...
  10. Replies
    38
    Views
    4,844

    Ok, I got it compiled now, it will run and accept...

    Ok, I got it compiled now, it will run and accept 1 list, I added what you mentioned:


    void AddToEnd(struct point *ptrN)
    {
    if(ptrFirst==NULL)
    ptrFirst=ptrN;
    ptrLast=ptrN;...
  11. Replies
    38
    Views
    4,844

    Here it is: #include #include...

    Here it is:



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

    struct point
    {
    int x; //point x
  12. Replies
    38
    Views
    4,844

    Attempted to re-write the functions to avoid the...

    Attempted to re-write the functions to avoid the whole global problem and using case 1 got:
    Declared in main:
    struct point *ptr=NULL;


    case 1:
    {
    ptr=InputRecord();
    AddToEnd(ptr);
    break;
  13. Replies
    38
    Views
    4,844

    Right, I understand that and made this: void...

    Right, I understand that and made this:


    void PrintList(struct point *ptrF)
    {
    while(ptrF != NULL)
    {
    printf("Label: %s\nx: %d y:%d\n\n", ptrF->label, ptrF->x, ptrF->y);
    ptrF =...
  14. Replies
    38
    Views
    4,844

    Assume it's the exact same but without recursion,...

    Assume it's the exact same but without recursion, when called nothing will print out, and that's got me confused.
  15. Replies
    38
    Views
    4,844

    Got addtobeginning and input record set now, and...

    Got addtobeginning and input record set now, and I think reset list is working, just gotta work on printlist


    void PrintList(struct point *ptrF)
    {
    struct point *pC = ptrF;
    while(pC != NULL)...
  16. Replies
    38
    Views
    4,844

    How does the prototype look when using struct, I...

    How does the prototype look when using struct, I have:
    struct point InputRecord(void);
    however I think its trying to read it in as a declaration.
  17. Replies
    38
    Views
    4,844

    These are my codes for adding to the beginning: ...

    These are my codes for adding to the beginning:


    case 2:
    {
    AddToBeginning(ptrFirst,ptrLast);
    break;
    }
  18. Replies
    38
    Views
    4,844

    I won't be able to work on it until later today...

    I won't be able to work on it until later today but you helped a bunch. Thanks and I will try to fix up where they point to.
  19. Replies
    38
    Views
    4,844

    added "break;" to all the cases, switched from...

    added "break;" to all the cases, switched from void to int main and added the case 0. Thanks CommonTater. Can you see any other problems with it, as I have looked it over again and still can't find...
  20. Replies
    38
    Views
    4,844

    In this case, the only function I see that needs...

    In this case, the only function I see that needs malloc() is the InputRecord function, I took temp out of global and added that to ResetList and changed from using if to switch statements in main. To...
  21. Replies
    38
    Views
    4,844

    Yea, I wasn't sure about the allocation thing...

    Yea, I wasn't sure about the allocation thing either, is it best to just use malloc() before the while loop? And I guess it was easy to make global, probably not the best but I think global works.
  22. Replies
    38
    Views
    4,844

    Added temp globally: struct point *ptrFirst...

    Added temp globally:


    struct point *ptrFirst = NULL;
    struct point *ptrLast = NULL;
    struct point *ptrNew = NULL;
    struct point *temp=NULL;

    Modified the function to this:
  23. Replies
    38
    Views
    4,844

    Took a few mins to look over what you mentioned...

    Took a few mins to look over what you mentioned here is what I came up with:




    void AddToBeginning(struct point *ptrF, struct point *ptrL)
    {
    if(ptrF==NULL)
    ptrF=ptrNew;...
  24. Replies
    38
    Views
    4,844

    It segements when I try to enter a number for...

    It segements when I try to enter a number for input inside main, and sorry about the horrible coding... I really have a lot to learn.
    It prints out the menu and I enter the number for the list it...
  25. Replies
    38
    Views
    4,844

    Yea, I meant to get that done, here it is: ...

    Yea, I meant to get that done, here it is:

    void InputRecord(struct point *ptrNew)
    {
    printf("Please enter the 2 Data points(x and y):\n");
    ptrFirst=ptrNew;
    if(ptrNew==NULL)
    printf("No...
Results 1 to 25 of 44
Page 1 of 2 1 2