the dots are just a list of functions that get compiled in special cases, which I am not using.
but the g option helped, thank you, I have managed to track down in which function it actually fails....
Type: Posts; User: Layla_E
the dots are just a list of functions that get compiled in special cases, which I am not using.
but the g option helped, thank you, I have managed to track down in which function it actually fails....
There is a c shell mak_mak script that creates a makefile from another file. I've added the cshell script in the attachment (saved as txt just because of upload permissions)
And this is in the...
I don't really understand what the code writer meant with sprintf, but the lines of the file are meant to be of a certain max length, so if this is, as you say, terminating the string at that point,...
As for compiling, the script is a part of a software and I don't compile directly with a compiler but with a script that compiles more things at once and sets everything so I don't know how to add ...
For your last question, I don't know if the empty format does anything.
I've tried with gdb and I get:
Program received signal SIGSEGV, Segmentation fault.
0x00000000004899a3 in ?? ()...
I am debugging a lot of scripts that I hadn't written myself and there are hundreds of functions so it would be impossible to copy everything and I am not sure even if copying this will help at all....
Thank you for the answer. No I am not testing that the file opened because it opens every time. The segmentation fault happens actually after the script had read the second file (file 2 or b) and...
I am running a C script which calls many subroutines. I have tested and used without problems this script before with slightly different inputs. Now I noticed I get a "segmentation fault (core...
I am using Linux CentOS. I have copied my C source codes directory and my bin directory from my local computer to a server location and I ran those copied scripts (I changed my path also to find...
If a function is defined as
int myfunction (int var1, int var2, struct mystruct *structname, double x, int x_flag) {
...
return 0;
}
Thank you, this with overwriting explains A LOT!
Thanks a lot, it works now! Do you have any idea why the way I did it before your correction works with some other structures and does not work with this one?
Do function1 and function2 need to be...
Ok so these are my two functions:
int function1(struct pre_block *ppp){
int a;
int b;
int c;
int i;
I have a file where I have two functions, function1 and function2.
Both these files are called from the main script.
I have a structure pre_block ppp:
struct pre_block {
int *blk;
I want to allocate memory to a structure which is a member of another structure. I can find many examples online how to allocate memory to an array of structures or a structure pointer, but what I...
Thank you, this works now!
Do you know perhaps why it seemed as if it works fine even without memory reallocation, i.e. the code as it is in my question with malloc, but without realloc?
I want...
Hi, sorry that was my mistake while simplifying the code and copying it here, thanks, malloc was actually originally in the outer loop, not the inner so that wasn't the problem. I edited the question...
I want to create arrays within structures whose sizes I do not know untill I finish the loop.
I thought I needed to reallocate the size after every loop iteration is done so that it would have...
Thank you both, for pointing out to me that char[5] is an array and telling me to use strcpy to assign values!
I don't get any compiling errors now.
Hello,
I need to assign a value of the member aaa->myhouse[co1].id to aaa->myflat[co1].id.
myhouse and myflat are both arrays of structures within the structure aaa. They contain different...
Thanks Jim, that helps a lot!
And in the other part of the code when it's (int) *, what is the meaning? Why can't it be "size of int * (blk -> no_sss+1)"?
I've been looking through textbook about...
Hi,
can the asterisk sign mean anything else in C other than pointers and arrays? What does it mean when it's in a bracket after a declaration like below?
And what does it mean when a function...