Search:

Type: Posts; User: C_me_run

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Lol, that's correct, so it "consumes" a...

    Lol, that's correct, so it "consumes" a character.

    Missing these little things makes me feel so dumb.
  2. this version of getchar/putchar removes a character from output

    So here is short/simple program that just takes your keyboard input, and outputs it when you press enter:



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


    int main()
    {
  3. Replies
    17
    Views
    12,276

    Okay, whatever, there's no harm in understanding...

    Okay, whatever, there's no harm in understanding how sizeof works. There's also no harm in learning C through whatever methods work for you. Putting arguments to sizeof in parens makes the code...
  4. Replies
    17
    Views
    12,276

    People learn in their own way, it doesn't hurt to...

    People learn in their own way, it doesn't hurt to learn about how sizeof works. You can't use sizeof properly w/o understanding it uses byte size by default.

    I personally think it's bad practice...
  5. Replies
    17
    Views
    12,276

    Yeah that's true, but it's also better to...

    Yeah that's true, but it's also better to understand when you are starting out as a low-level programmer the size of elements of different data types, it's true your method is more flexible though...
  6. Hmmm, i was kind of confused by your post, but...

    Hmmm, i was kind of confused by your post, but now i am starting to understand your intent with posting here now...
  7. Replies
    17
    Views
    12,276

    The output is 5 because the array stops...

    The output is 5 because the array stops incrementing index when it reaches your element 0, as john.c explained with different words.

    Here is the working version of your program, "array[index]" is...
  8. finding specific words in a document is extremely...

    finding specific words in a document is extremely easy with vim. I didn't write the initial code, i just took it out of a book and improved upon it to make it more useful as an educational tool.

    I...
  9. I'm not sure why you would just post this code...

    I'm not sure why you would just post this code for me since you admitted you don't understand what I was getting at with my questions, you haven't explained how getting rid of global variables from a...
  10. No it does what it's supposed to do. I used to...

    No it does what it's supposed to do. I used to have that same code in my other programs, but I discovered that adding the EOF condition for that loop doesn't add any safety to the program. On linux...
  11. revisions for clarity

    Yeah, i can't really show you what i am getting at without the correct spacing, as that was the point of the very simple ascii art in the program. I'll try with code tags:



    S)how, A)dd,...
  12. Nice work! I didn't even notice that there was an...

    Nice work! I didn't even notice that there was an issue with how the records were displayed, i just noticed that for some reason after running add(), the current->next pointer added wasn't NULL like...
  13. not sure why links in this program are not always null

    So laserlight asked me to talk about "my" linked list in the most recent thread i posted here about NULL pointers.

    However, I have only made edits to someone elses linked list, and i have been...
  14. I didn't get that error, oh well, the internet is...

    I didn't get that error, oh well, the internet is strange.
  15. Thanks for clarifying that, i believe that's what...

    Thanks for clarifying that, i believe that's what laserlight was saying but i was distracted by the other terminology.
  16. It's initialization and assignment, unless "=" is...

    It's initialization and assignment, unless "=" is not an assignment operator (and yes it is)



    No, actually this is not true at all. Let me prove it:


    #include<stdio.h>
    int main()
    {
  17. Question related to NULL assignment in pointers to structs

    Let's say we have this code under the pe-processor directives, as if we were going to create a linked list:



    struct node
    {
    int value;
    struct node *next;
    };
  18. Yes, you are right, once i understand the entire...

    Yes, you are right, once i understand the entire readline function (and everything else it needs to work), then there would a solution.
  19. Yes I'm very familiar with bc and a bunch of...

    Yes I'm very familiar with bc and a bunch of other bash utilities, yet it's a programming language and not really a calculator.
  20. That is an illustration of how the larger idea...

    That is an illustration of how the larger idea could possibly work, and thank you, but I am mostly concerned with how to pass the converted string to readline properly, and where exactly the best...
  21. Replies
    12
    Views
    6,418

    As a linux desktop user, I really like the looks...

    As a linux desktop user, I really like the looks of that book, and am surprised I haven't come across it because I have looked for a book on GUI programming in C multiple times over the past year....
  22. issue trying to store math equation answers in readline()

    So I decided to try and make a command line calculator, but discovered that I don't understand memory management and buffering well enough to parse out an expression like this:

    5 + (4 * 1)

    it...
  23. Those were my initial thoughts, Salem had the...

    Those were my initial thoughts, Salem had the correct answer. All arrays need to at least have the additional space for the null pointer for them to function properly. I've tested both of these and...
  24. Why is the first array getting printed twice when both arrays are ordered like this?

    Created a program that converts one string to upper case, then another string to lower case. For some reason, if in the main function, i declare the first array on top of the second, the loop prints...
  25. Oh, well as i explained, the code isn't mine. I...

    Oh, well as i explained, the code isn't mine. I wouldn't put parenthesis around a return value because it's more typing. Also, i see your point about the for loop, because we wouldn't have to declare...
Results 1 to 25 of 37
Page 1 of 2 1 2