There is no 'Seg fault.' printed out.
What does it indicate?
How to test the return value of malloc?
Type: Posts; User: siubo
There is no 'Seg fault.' printed out.
What does it indicate?
How to test the return value of malloc?
I think I have declared it. As I mentioned, there is a similar function called 'extract_ip_patterns' which is used in the same program.
But, there is no problem on using this function. And, I have...
I'm sorry that I don't understand your reply
I'm sorry that I can't understand. Can you explain it in more details?
I change it because I have a segmentation fault when I run my program. I have posted this message before.
Somebody said that I did sth. wrong with the memory. So, I try to change it to fix the...
I have defined two functions:
extract_ip_patterns and extract_op_patterns.
They are almost the same and used in the same main program. But there is a warning message about extract_op_patterns:
...
When I follow the FAQ to change
#define Malloc(type,n) (type *)malloc((n)*sizeof(type))
to
#define Malloc(ptr,n) malloc(n*sizeof *ptr),
however, error messages are come out:
cannot convert...
I'm sorry that I haven't read the FAQ before posting question. Thank you for reminding me.
What is n?
This is part of my code where I guess that the problem is here:
**************************************************
void read_problem(char *filename)
{
int elements, max_index, i, j, index,...
I'm running my C program on Linux. An error message is come out:
Segmentation fault
Can anyone help me to suggest any possible reasons which cause the error>
What does it mean?
#define Malloc(type,n) (type *)malloc((n)*sizeof(type))
What is the use of malloc()?
How to use it? And, what is the return of malloc()?
Thank you all to reply me
Dear all,
In C/C++, is there a built-in function called gnuplot in Linux OS? It is used to create a 2-D plot.
Also, is there Matlab in Linux OS?
This is my C code:
int main(int argc, char **argv)
{
vec_t **x;
PATTERN *pat;
unsigned long num_patfiles, total_num_pats;
pat = (PATTERN *) get_pattern("faem0.test.pds",...
what is the difference between 1 & 2?
1. pat = (PATTERN *)
vector(1,(int)*num_patfiles,sizeof(PATTERN));
2. pat = PATTERN * vector(1,(int)*num_patfiles,sizeof(PATTERN));
Thank you for your reply
I have met the following code:
#ifndef vec_t
typedef VECTOR_TYPE vec_t;
#endif
Is VECTOR_TYPE a program default word or uer defined word?
Thank you for your reply
Can you explain more about what means of 'If you don't specify the object file with -o, it defaults to a.out.'?
Also, if i have a file to pass in the program, how can I do this?
I'm a beginner to use Linux OS. I don't know how to compile and run a C program in Linux. Can anyone help one?
Dear all,
This is my first time to post message here. I'm glad to see you all here.
I have met a function called Malloc. There is a line as below:
#define Malloc(type,n) (type...