Search:

Type: Posts; User: Layla_E

Search: Search took 0.01 seconds.

  1. the dots are just a list of functions that get...

    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....
  2. There is a c shell mak_mak script that creates a...

    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...
  3. I don't really understand what the code writer...

    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,...
  4. As for compiling, the script is a part of a...

    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 ...
  5. For your last question, I don't know if the empty...

    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 ?? ()...
  6. I am debugging a lot of scripts that I hadn't ...

    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....
  7. Thank you for the answer. No I am not testing...

    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...
  8. segmentation fault depending on location of file

    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...
  9. Replies
    3
    Views
    5,540

    recompiling when moving source code?

    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...
  10. Replies
    1
    Views
    6,477

    Input functions calling

    If a function is defined as


    int myfunction (int var1, int var2, struct mystruct *structname, double x, int x_flag) {

    ...

    return 0;
    }
  11. Replies
    6
    Views
    8,384

    Thank you, this with overwriting explains A LOT!

    Thank you, this with overwriting explains A LOT!
  12. Replies
    6
    Views
    8,384

    Thanks a lot, it works now! Do you have any idea...

    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...
  13. Replies
    6
    Views
    8,384

    Extension to the question

    Ok so these are my two functions:


    int function1(struct pre_block *ppp){

    int a;
    int b;
    int c;
    int i;
  14. Replies
    6
    Views
    8,384

    Passing a structure pointer

    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;
  15. Replies
    2
    Views
    5,131

    Allocating memory to a structure

    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...
  16. Replies
    5
    Views
    4,843

    Thank you, this works now! Do you know perhaps...

    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...
  17. Replies
    5
    Views
    4,843

    Hi, sorry that was my mistake while simplifying...

    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...
  18. Replies
    5
    Views
    4,843

    Dynamic arrays initialization

    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...
  19. Thank you both, for pointing out to me that...

    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.
  20. Assigning value of a member of one structure to another

    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...
  21. Thread: asterisk

    by Layla_E
    Replies
    4
    Views
    3,330

    Thanks Jim, that helps a lot! And in the other...

    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...
  22. Thread: asterisk

    by Layla_E
    Replies
    4
    Views
    3,330

    asterisk

    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...
Results 1 to 22 of 22