Forum: C Jul 9th, 2009 |
| Replies: 11 Views: 507 Hello everyone! It's me again.
I replaced malloc calls with calloc and I put sizeof(char*) for the memory allocation call for the rows of the 2D array. There are no runtime errors.
Thank you... |
Forum: C Jul 9th, 2009 |
| Replies: 11 Views: 507 Unfortunately, no. Now I have a runtime error on the free() call at the last line of fillArray(). The change of char* to char for referenceArray has introducted a new problem in the fillArray()... |
Forum: C Jul 8th, 2009 |
| Replies: 11 Views: 507 Ok, here is the complete code.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//Variables globales.
int width;
int height; |
Forum: C Jul 8th, 2009 |
| Replies: 11 Views: 507 I don't think that I'm freeing the 2D array twice, because it is filled first in the fillArray() function. The referenceArray pointer is cleaned first and points to the newReferenceArray pointer.... |
Forum: C Jul 8th, 2009 |
| Replies: 11 Views: 507 Hello, everyone!
I have a problem with memory free. Here is the necessary code to understand the problem:
void fillArray(char** referenceArray, FILE* grid)
{
//ChaƮne qui va contenir une... |
Forum: C Mar 25th, 2009 |
| Replies: 4 Views: 480 See this page: http://www.cppreference.com/wiki/keywords/switch.
Google showed me this Web site in less than 1 second and it took that amount of time to see the content. |
Forum: C Feb 23rd, 2009 |
| Replies: 2 Views: 295 Use &type_of_gas instead of type_of_gas.
Without more code, I cannot help much further. |