Advertisement

1 - 10 of 20 containing alltags:("calloc") (0 seconds)
Hi, I'd like to open some files (let's say 50) and i thought to put pointers to those files in an array. I have the following declaration: tab = (FILE**) calloc(num_of_files, sizeof(FILE*)); ...
Zones: C++Date Answered: 03/17/2001 Grade: A Views: 0
Hello everyone, I'm creating a MFC DLL which will be called by a C app.  I need to dynamically create/resize structure arrays so Im using calloc/resize/free.  While calloc seems to work fine for...
Zones: MS Visual C++Date Answered: 07/09/2006 Grade: B Views: 0
Hi! Here as an example of what I'm trying to do: void string_copy(char *target_ptr); void main(void) {   char *p1="";   string_copy (p1);   printf (p1); } void string_copy (char ...
Zones: CDate Answered: 02/03/2003 Grade: A Views: 0
I am an undergraduate student in computer engineering, I am trying to understand why the following code gives a "Segmentation fault" in Run-time. What I know about segmentation fault is that it occ...
Zones: Programming, Kernel ProgrammingDate Answered: 06/09/2003 Grade: B Views: 0
#define SIZE 0xFFFFFFF       unsigned int *buffer0 = (unsigned int*)calloc(SIZE, sizeof(unsigned int));       unsigned int *buffer1 = (unsigned int*)calloc(SIZE, sizeof(unsigned int));       unsigned int *buff...
Zones: C++Date Answered: 02/21/2005 Grade: A Views: 0
hello How do I reallocate memory for an array whose memory was allocated using the calloc function? Here is my test code: #include "stdafx.h" #include <iostream> using namespace std; i...
Zones: C++Date Answered: 08/07/2006 Grade: A Views: 0
I'm taking a C-programming course this term and my instructor did not explain the use and syntax of calling the calloc function very well. My question is, does a statement that calls calloc to gene...
Zones: CDate Answered: 03/06/1998 Grade: A Views: 4
Hi all,    Is malloc allocates sequential chunk and calloc doesn't?    if so how and why?                                                      With Regards,                                     ...
Zones: CDate Answered: 05/20/2004 Grade: A Views: 15
char **info = NULL;   /* global var */ int  getInfo(char **x) { ... ...      x = (char **)calloc(10, sizeof(char *));     for(i = 0;i < 10; i++)     {         x[i] = (char *)calloc(10,siz...
Zones: CDate Answered: 04/16/2004 Grade: B Views: 0
Hi all, I have the following code: struct sockaddr_in *Array; Array = (struct sockaddr_in *) calloc(2, sizeof(struct sockaddr_in)); This code compiles just fine with gcc3.3.3, but wit...
Zones: C, Microsoft Visual C++Date Answered: 03/23/2005 Grade: A Views: 0