CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: riechan

Page 1 of 2 1 2

Search: Search took 0.09 seconds.

  1. Re: strcmp on Linked List data and string constants?

    sorry, it seems to be working just fine. strcmp() returns a 0 when both character arrays are the same. :)
  2. [RESOLVED] strcmp on Linked List data and string constants?

    Was wondering why strcmp() doesn't return true when comparing a string constant with a string that was acquired via a linked list. By the way, the data in the linked list was taken from a text file....
  3. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    Thanks, for that very detailed explanation 2kaud! Looks like I have a huge lot to learn about linked lists (among other things). I'll try to digest this for a while :)
  4. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    Wait, I tried doing this:



    void cacheData(char a[60]){
    ...
    strcpy(newNode->ACNM, a);
    ... }
  5. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    Yup, edited them. Thanks. :)

    I have a question, this will possibly clear up all of my confusion in the crtNode(), or make it even more confusing for me (hopefully not). Taking your code as an...
  6. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    Questions/Clarifications:


    while(curNode)

    This is the same as while(curNode != NULL) right?


    static struct Node *tail = NULL;
  7. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    @2kaud: Thanks for the hint... I tried doing it like this:



    void crtNode(int val){
    struct Node *newNode, *curNode;

    // curNode must be initialized at start node
    // because it will...
  8. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    Wait, sorry, let me see if I got this properly. In this code:



    if(newNode != NULL){
    newNode->Data = val; //save the data to current Data node
    newNode->next = NULL; //point the next...
  9. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    I tried using the Debug and Watch in Turbo C (used start and val for the watched values) but it said undefined symbol on both instances. Then I tried using Watch on CodeBlocks but it doesn't look...
  10. Replies
    25
    Views
    22,789

    Re: Linked Lists and Pointers

    But I did set start to NULL:



    int main(){
    int opt, val;
    start = NULL;
    ...
  11. Replies
    25
    Views
    22,789

    Linked Lists and Pointers

    Hi guys, I'm trying to learn how to use Linked Lists. I was wondering if you guys can give me pointers here...

    1. Freeing memory allocation - I don't understand the concept of free() that much. I...
  12. Thread: alloc.h

    by riechan
    Replies
    3
    Views
    2,390

    Re: alloc.h

    I see. Thanks for clearing that up 2kaud! :)
  13. Thread: alloc.h

    by riechan
    Replies
    3
    Views
    2,390

    alloc.h

    Has anyone used CodeBlocks (MingW plugins) here? I can't seem to use the alloc.h library. When I try to compile my code, the compiler can't seem to find the alloc.h...



    I tried compiling the...
  14. Re: Is there such a thing as code withdrawal in a compiler?

    It's okay now. Solved it! I'm such a scatterbrain! hahaha
  15. Re: Is there such a thing as code withdrawal in a compiler?

    scratch this post. i saw what the problem is. hahaha :D
  16. Re: Is there such a thing as code withdrawal in a compiler?

    I was looking at this:

    http://www.cplusplus.com/forum/general/39982/

    And it said that system() is a non-standard function, and is OS-dependent (Windows). Is there any other way for us to run an...
  17. Re: Is there such a thing as code withdrawal in a compiler?

    I know, that's why:



    do {
    printf("Please enter your name (50 characters max): ");
    fflush(stdin);
    fgets(nme, sizeof(nme), stdin);
    printf("\nName: %s", nme);
  18. Re: Is there such a thing as code withdrawal in a compiler?

    @SeventhStar: Before the fflush(), if the input is "Rie Ishida", it only got the "Rie" part and saves the "Ishida" part to the following scanf().

    Cool! Thanks a lot! That fixed my problem with the...
  19. Is there such a thing as code withdrawal in a compiler?

    By code withdrawal, I mean, like certain functions not working at all (or being shunned/passed by the compiler). In the code below, I've been getting to make the fgets() work in Turbo C (running in...
  20. Replies
    28
    Views
    5,312

    Re: Assigning a value to struct variables?

    I suppose I'll be using long integer for the time being, since floating point numbers have been very erratic. But, I'll revise the data types once I finish coding everything. I'll follow up on you...
  21. Replies
    28
    Views
    5,312

    Re: Assigning a value to struct variables?

    @2kaud: Just made a couple of changes with the code. I used your test data and the results were all correct, surprisingly:

    31641

    I'm thinking it's because I used float instead of double? And in...
  22. Replies
    28
    Views
    5,312

    Re: Assigning a value to struct variables?

    I was told that using !feof() is a bad thing to do, so I guess I'll stick to my while statement? So the output is still the same. I really don't know what I'm doing wrong here, as to why the extra...
  23. Replies
    28
    Views
    5,312

    Re: Assigning a value to struct variables?

    @2kaud: Sorry, can you please explain this line:

    if (char *nl = strrchr(acct.name, '\n')) *nl = 0;

    I haven't used that many libraries yet, except for stdio/stdlib/math, so please excuse me. And...
  24. Replies
    28
    Views
    5,312

    Re: Assigning a value to struct variables?

    My output:

    123456.70 <- strbal
    Rie Ishida
    1234567890
    123456
    123456.703125 <- acct.bal

    The extra digits in the balance is back again.
  25. Replies
    28
    Views
    5,312

    Re: Assigning a value to struct variables?

    I might go for the fgets() route since I can't say if the account name consists of only two words or more. But what I want to know is why the data is not saved into acct's members...
Results 1 to 25 of 31
Page 1 of 2 1 2





Click Here to Expand Forum to Full Width

Featured