Search:

Type: Posts; User: totalnewbie

Search: Search took 0.01 seconds.

  1. arpsmack, thank you so much! It works greatly...

    arpsmack, thank you so much! It works greatly now.
    Why is it necessary to release memory two times:
    free(array[i]);
    free(array);
    I thought that free(array[0]) is the same as free(array).
  2. That's the testing program: int main(int...

    That's the testing program:



    int main(int argc, char ** argv) {

    /* check save & load */
    check_saveload(10);
    // check_saveload(100);
  3. glibc detected malloc(): memory corruption

    I am getting the error: "glibc detected malloc(): memory corruption: 0xb7fd3008" when function int ** load_table(FILE * file, int size) starts under UNIX. It works nicely under Windows. Do you find...
  4. Replies
    14
    Views
    13,715

    I am getting the error: "glibc detected malloc():...

    I am getting the error: "glibc detected malloc(): memory corruption: 0xb7fd3008" when function int ** load_table(FILE * file, int size) starts under UNIX. It works nicely under Windows.


    ...
  5. Replies
    14
    Views
    13,715

    Ok, just tell me wheter I am riht or not. 1. If...

    Ok, just tell me wheter I am riht or not.
    1. If I make 10x10 table (dynamic array) then all of these memory cells are side by side and figuratively speaking the beginning of the memory cell number...
  6. Replies
    14
    Views
    13,715

    I have that example:...

    I have that example: http://www.daniweb.com/forums/thread52253.html but I cannot find anything like that about multidimensional array. I've been looking for multidimensional example but haven't...
  7. Replies
    14
    Views
    13,715

    That's the write: ...

    That's the write:

    fwrite(table[x],sizeof(int),size,fp);
  8. Replies
    14
    Views
    13,715

    fread(&nitems,sizeof(int),1,file); returns the...

    fread(&nitems,sizeof(int),1,file);

    returns the number of lines as I've read from different sites.
    I don't know how fwrite and fread behaves with 2d arrays, how it distinguishes between x and y....
  9. Replies
    14
    Views
    13,715

    2d array and fwrite and fread

    Hi! I've been looking for working code example that uses 2d arrays with fwrite and fread but haven't found any. So I tried to realize it myself but I cannot get it work. The goal is to make 2d array...
  10. Replies
    7
    Views
    1,068

    Ok, it seems to work now. Just want to know why...

    Ok, it seems to work now. Just want to know why there is no need to multiply amount by size in returnPointer() function as I did in the main function?


    int main ( void )
    {
    char *q = NULL;
    ...
  11. Replies
    7
    Views
    1,068

    1. Do you mean variable 'save' by variable 'temp'...

    1. Do you mean variable 'save' by variable 'temp' as an example from called function?
    2. I don't understand what you mean by that sentence. I cannot distinguish amount and size at the moment.
  12. Replies
    7
    Views
    1,068

    Array of pointers

    I cannot get it work.
    The function returnPointer() returns pointer for every string I've inserted until it returns null value. I want to store all of these returned pointers in a dynamic array named...
  13. Replies
    1
    Views
    1,557

    Client and server, windows xp

    These two programs (6.1. A Simple Stream Server, 6.2. A Simple Stream Client) don't compile under win xp by using Dev-C++ environment:...
  14. Replies
    6
    Views
    13,168

    Numbers are the reason for error. I cannot locate...

    Numbers are the reason for error. I cannot locate the exact place where this error stems from. All I can say is that I have to change something in C code. Although at the moment this code seems to me...
  15. Replies
    6
    Views
    13,168

    Directories and files using dirent.h

    I've the following code written in C and it displays files (name and size) and directories (<dir> if it encounters directory which is not hidden or not link) but it's not able to pass testing...
  16. Replies
    16
    Views
    7,584

    4. I've been checking examples which at first use...

    4. I've been checking examples which at first use malloc and then realloc. That's why I used to think that it's not possible to use malloc and realloc separately.
    5. I usually program in Java,...
  17. Replies
    16
    Views
    7,584

    What if I want to put these characters into...

    What if I want to put these characters into multidimensional array?
    Scrutinizing your code I cannot see where memory space checking takes place. The size of the memory is increased by 5 units
    ...
  18. Replies
    16
    Views
    7,584

    My goal is to implement a program which allocates...

    My goal is to implement a program which allocates some space to array and then reads user input and puts it into array. If it runs out of memory it reallocates the memory by certain amount and copies...
  19. Replies
    16
    Views
    7,584

    Malloc function and program crash

    I try to learn malloc function and I have some problems. This program compiles nicely but it crashes after I have entered one line text and pressed enter. Array is the array where I try to allocate...
Results 1 to 19 of 20