Hi,
I'm doing quite a simple thing which is giving me problems. I m allocating memory for a 3dimensional array as the following:
double ***alloc()
{
double ***tp;
int x;
long t;
tp=(double ***)calloc(maxt,sizeof(double **));
for(t=0;x<=maxt;t++)
tp[t]=(double **)calloc(maxx+1,sizeof(double *));
for(t=0;t<=maxt;t++)
for(x=0;x<=maxx+1;x++)
tp[t][x]=(double *)calloc(maxy+1,sizeof(double));
return tp;
}
however when i call this function, the program exits and does not execute the rest of the commands in the main().
PLease have anyone ecountered such a problem?
I m using lcc-win as a compiler,
regards
alan
2 1149
Hi,
I'm doing quite a simple thing which is giving me problems. I m allocating memory for a 3dimensional array as the following:
double ***alloc()
{
double ***tp;
int x;
long t;
tp=(double ***)calloc(maxt,sizeof(double **));
for(t=0;x<=maxt;t++)
tp[t]=(double **)calloc(maxx+1,sizeof(double *));
for(t=0;t<=maxt;t++)
for(x=0;x<=maxx+1;x++)
tp[t][x]=(double *)calloc(maxy+1,sizeof(double));
return tp;
}
however when i call this function, the program exits and does not execute the rest of the commands in the main().
PLease have anyone ecountered such a problem?
I m using lcc-win as a compiler,
regards
alan
tp is a local variable the value of which is lost when the function returns. Either pass in it to the function as a parameter from main(), define it as static or make it global
Hi,
I'm doing quite a simple thing which is giving me problems. I m allocating memory for a 3dimensional array as the following:
double ***alloc()
{
double ***tp;
int x;
long t;
tp=(double ***)calloc(maxt,sizeof(double **));
for(t=0;x<=maxt;t++)
tp[t]=(double **)calloc(maxx+1,sizeof(double *));
for(t=0;t<=maxt;t++)
for(x=0;x<=maxx+1;x++)
tp[t][x]=(double *)calloc(maxy+1,sizeof(double));
return tp;
}
however when i call this function, the program exits and does not execute the rest of the commands in the main().
PLease have anyone ecountered such a problem?
I m using lcc-win as a compiler,
regards
alan
Hi Alan,
Can you post your full code?
It will be useful to identify the problem very easily.
Regards,
M.Sivadhas.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: sudhakar |
last post by:
Hi,
Iam interested in doing thesis on XML. can anybody suggest
some thesis topics in XML?
sudhakar
|
by: 63q2o4i02 |
last post by:
Hi, I've been thinking about Python vs. Lisp. I've been learning
Python the past few months and like it very much. A few years ago I
had an AI class where we had to use Lisp, and I absolutely...
|
by: podi |
last post by:
Hey!
If anyone found any interesting title of master thesis from any areas
as:.NET, webservices, biztalk...
ANY suggestions would be nice to read. It can be implementation,
integration or...
|
by: Alan |
last post by:
Hi, I m working on thesis on mechanical engieering. I m using C to
solve a particualr problem.
I have this code underneath which is giving me problems:
for (t=0;t<=maxt;t++){
printf("testing...
|
by: Edwin |
last post by:
Hello,
I want to write master degree thesis about ASP. NET, but I'm programming in
..NET for just 4 months. I was thinking about something about "Integration
informations system in ASP. NET (Web...
|
by: Gabriel |
last post by:
Hi All,
(First my apologies for this kind of "spam" message. But for my thesis
this will be my once in a lifetime spam moment... )
At the moment I have to graduate for my master in Business...
|
by: zabaladesign |
last post by:
hello guys.. please help me i made a program for my thesis and i need a
textbox which will only accept telephone number like this format
(954)-854-2452 .. please... please help me guys i really...
|
by: =?UTF-8?Q?Filip_Gruszczy=C5=84ski?= |
last post by:
Hello there,
I am student of CS at the University of Warsaw, currently 4th year. I
am attending Object Oriented Programming seminar and it is about time,
I started looking for an idea of my...
|
by: Terry Reedy |
last post by:
"Filip Gruszczynski" <gruszczy@gmail.comwrote in message
news:1be78d220806021653k12099b69s7888db0adb187c07@mail.gmail.com...
| Hello there,
|
| I am student of CS at the University of Warsaw,...
|
by: Eric Davidson |
last post by:
As part of my thesis for my MSc Course with the Open University UK, I
need to collect various performance statics for IBM's DB2 database on
Windows.
To this end I have developed a performance...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |