Search:

Type: Posts; User: LanguidLegend

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    2,942

    Thanks anduril for all your help... :) I'm just...

    Thanks anduril for all your help... :) I'm just about done I think but I have one last thing tripping me up.

    void printList(struct linked_list* list)
    { struct linked_list *temp = list;
    int len...
  2. Replies
    9
    Views
    2,942

    The assignment I was given instructed me to...

    The assignment I was given instructed me to follow the following sample format:

    $./list
    Enter a command: 67

    Enter a command: 89

    Enter a command: +
    67 + 89 = 156
  3. Replies
    9
    Views
    2,942

    Updated program

    Thanks for all your quick replies, I've read them over and have tried to update my code accordingly (pasted below).
    However I'm still having a pointer problem. On the second pass through line 34,...
  4. Replies
    9
    Views
    2,942

    Thanks for your quick reply :) Well, what I'm...

    Thanks for your quick reply :)

    Well, what I'm trying for in that part of the code is for result to just to create list nodes for result which will receive the sum of the corresponding first and...
  5. Replies
    9
    Views
    2,942

    Pointers & dereferencing confusion

    Ok, so I'm working on an assignment using linked lists to add/subtract large numbers. This is what I have so far:

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

    struct linked_list {
    int data; /*...
  6. Replies
    2
    Views
    2,511

    Thanks for the quick response! *thumbs up* :)

    Thanks for the quick response! *thumbs up* :)
  7. Replies
    2
    Views
    2,511

    Bizarre string overwriting

    Ok, so I'm working on this assignment which is supposed to somewhat imitate Unix's cp command (with files "foo.txt" and "bar.txt"). It's been going good up until this section:

    char* getPath(char*...
  8. I tried looking on the GNU C Library website, but...

    I tried looking on the GNU C Library website, but couldn't find a list of library functions. Could you link me to a list or just to the atoi function page?

    Thanks!
  9. thanks for the quick response! :) hmm oh yea I...

    thanks for the quick response! :)
    hmm oh yea I remember about that now that you mention it - pre-processing -> compiling -> assembly -> linking

    well do you know where I can find the assembly file?
  10. Location of library functions' implementations

    Well I've been curious for a while as to where I can find the file(s) which show the actual implementation of library functions such as atoi(const char *str). I found the stdlib.h header file, but...
  11. #include char bufone[2] = {}; int...

    #include <stdio.h>

    char bufone[2] = {};

    int main(int argc, char* argv[])
    {
    __asm__("\
    movl $'A', bufone\n\
    ");
  12. How to assign an ASCII character via inline assembly code

    I am having difficulties executing a short __asm__() exercise:
    Write assembly code to store char 'A' into bufone[0].

    I would think it should look like this:

    #include <stdio.h>

    char* bufone;...
  13. Can you give me an example of how to build an...

    Can you give me an example of how to build an output buffer then write it to the screen? Sorry for my inexperience..
    Thanks!
  14. Yes I thought about that, but once I process a...

    Yes I thought about that, but once I process a character via getchar(), I can't revisit it.
    Which is why I was trying to make a char array (ie: a string) to store each line before exiting the while...
  15. Thanks everybody, I think I understand the issue...

    Thanks everybody, I think I understand the issue much better now.

    SO this boils down to the ultimate goal of my program, to parse bracketed tags (opening & closing tags like in XML), and return...
  16. Why does it return an int? Is there a function...

    Why does it return an int?
    Is there a function that can read a line from standard input (ie: keyboard input) and save it as a string? That's really what I need to make this program function..
  17. Thanks for the quick reply. So how would I go...

    Thanks for the quick reply.
    So how would I go about using malloc(), and how much space should I allocate?

    To give you an idea, this is what I am looking to parse (one line at a time):

    <level1>...
  18. Segmentation fault when appending to strings (char *)

    So I'm trying to implement this simple program which essentially parses a simple (untabbed, simple tags) XML file and returns it in a tabbed format, but I've been stuck on trying to append to a...
  19. Replies
    8
    Views
    5,323

    int to 32-bitstring program

    Ok, so I am trying to make a program that takes two ints, converts them to 32-length bitstrings, (one <mask> filters the other <num>), and return a filtered bitstring of same length.
    Example:...
  20. How to access individual characters in an array?

    This is my code:

    char get_bits_squeeze(char num, char mask)
    {
    num = print32bits(num);
    mask = print32bits(mask);
    char activeBits;
    for (int i=0;i<32;i++)
    { if (mask[i]=='1')...
  21. Computing factorial w/ IA32 cycle counter (C Assembly)

    Ok, so I have this problem I need to finish by tonight, and I am desperate for some help/a solution. I've completed most of it, but I am stuck, wondering if someone can help me out with the...
  22. Assembly Integration (Unsigned Integer Multiplication)

    Hi, can you help with a C programming assignment?
    So a small part of the course covers writing/compiling assembler code as well, & I'm having some trouble figuring it out:

    Basically it deals with...
Results 1 to 22 of 22