Search:

Type: Posts; User: kbfirebreather

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Okay, so immediately after posting this, I think...

    Okay, so immediately after posting this, I think I may have found the source of the issue. strcat() in the while loop is causing the memory corruption. Commenting that out, and the realloc() error...
  2. Having issue with realloc in custom str_replace function. Invalid next size error

    After looking online for a string replace function in C and finding so many examples that go through the entire string twice. First round to find how number of occurances of substitute in string,...
  3. Today I learned. Thank you for explaining that to...

    Today I learned. Thank you for explaining that to me. Would have never found this out if it weren't for the system I was using!
  4. Thanks for taking the time looking into this....

    Thanks for taking the time looking into this. Very strange. I'll just leave it as is at the moment as this should hopefully not be a problem for me as long as I don't do weird offsets like the...
  5. Yeah, it works beautifully on x86 machines, but...

    Yeah, it works beautifully on x86 machines, but the ARM is definitely doing something strange.
  6. Size of int, and int* both return the value of 4....

    Size of int, and int* both return the value of 4.

    Yes, i would normally do as you suggested, main_pointer + sizeof(int *), but the point behind this little script is to leave bits 4 and 5 as dead...
  7. Okay, so I figured out what's happening, but not...

    Okay, so I figured out what's happening, but not sure why or how to deal with it.

    I modified the code a little bit:

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

    int main(void){

    //10 byte bank
  8. You are right, my comment is incorrect, but the...

    You are right, my comment is incorrect, but the idea is still the same. I had co-workers run it as well and get the correct results. I think it's the architecture of my server, looking into it now.
  9. I'm refreshing my memory, and am having strange behavior playing around with pointers

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

    int main(void){
    //10 bit memory bank
    char *main_pointer = malloc(10);

    // array of 2 integers (8 bits)
    int **int_pointer_array =...
  10. Thank you! I can't believe I spend 12 - 3 last...

    Thank you! I can't believe I spend 12 - 3 last night and didn't figure this out. Rusty Rusty C. Thanks again.
  11. I have a bug with fgets that I can't figure out

    The code is located at: C code - 79 lines - codepad

    The problem I'm having is in askUserForAmount();

    http://i.imgur.com/Ic4XcXJ.png is my output.

    I use "Title here" for title.

    I use...
  12. I'm getting multiple errors with attempting to...

    I'm getting multiple errors with attempting to use that method. Should the fgets function be in the format of


    char buf[100];
    int BUFSIZ = 100;
    fgets(buf, BUFSIZ, fp);

    and should the sscanf...
  13. Reading Lines from File Issue (integers and character strings)

    I'm trying to find a way to input data from a file, line by line, into two separate arrays.

    Say I have a file, input.txt:
    3 hp psc 2210
    0 inkjet
    100 laserjet

    I need to first, get the number,...
  14. If an INITSIZE isn't required for my case, I can...

    If an INITSIZE isn't required for my case, I can go ahead and findNewSize(); and use that value to malloc the array. Is this correct?
  15. Thank you very much, I'm gonna go ahead and mess...

    Thank you very much, I'm gonna go ahead and mess around with this.
  16. so I would have.... #include ...

    so I would have....



    #include <stdio.h>
    #include <string.h>

    int *intArray[];
    char *charArray[];
  17. How do you change the size of a global array?

    I've been trying to find the solution to this, but have been consistently coming up empty handed.

    Say I have 2 global arrays, one of char and one of int



    #include <stdio.h>
    #include...
  18. Well the receiving side reads the message which...

    Well the receiving side reads the message which should have the type in the rcvbuf struct that's passed through the function. which is where you have to detect for the last message which is one thing...
  19. Replies
    7
    Views
    6,519

    Hey, I actually made another thread, if you have...

    Hey, I actually made another thread, if you have any input, please reply :)

    http://cboard.cprogramming.com/showthread.php?p=831753#post831753
  20. well I believe I am using MTYPE and MEND correct?...

    well I believe I am using MTYPE and MEND correct? In send file, when we get to eof that means that the last message is being sent, so when c==1 (eof), i set the .type to MEND, then in rcv file I have...
  21. Well I think my problem is in rcv_file, but I...

    Well I think my problem is in rcv_file, but I feel like I'm not handling it correctly. When I run the program it always tells me that "rcv_file failed" which is because rcv_file is returning -1, but...
  22. When you execute the program, in my case I would...

    When you execute the program, in my case I would do..



    cse473-ipc inputfile outputfile


    the input file gets sent to send_file, and the output file gets sent to rcv_file

    is that what you...
  23. Linux IPC - reading/writing files, getting garbage

    thanks, I think I have it from here
  24. Replies
    7
    Views
    6,519

    Okay, so I've been looking at your suggestions...

    Okay, so I've been looking at your suggestions and I'll just go down the list.

    The first one is what you said in create_ipc function. I was thinking the same thing you were, but it looks like my...
  25. Replies
    7
    Views
    6,519

    Thank you for the input, a lot of that makes...

    Thank you for the input, a lot of that makes sense. The comments with closing stdin and stdout are incorrect, because my roomate showed me I was closing the wrong ones in the wrong functions but...
Results 1 to 25 of 26
Page 1 of 2 1 2