Search:

Type: Posts; User: s_siouris

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,144

    autotools help

    Hello,

    I have developed a program that uses two additional libraries not usually found in linux systems. Since I am using my own linux machine, I have root access and can install these in the...
  2. Replies
    5
    Views
    1,166

    thanks for your reply, I think it was late at...

    thanks for your reply, I think it was late at night when I posted this and was too tired to think straight... I guess sometimes it happens!
  3. Replies
    5
    Views
    1,166

    Simple question about scope

    Hi all,

    I need to declare a variable that is only used in a do-while loop, and my question is where to best declare and initialise it. I have been reading that it is best to declare variables at...
  4. Replies
    5
    Views
    2,095

    I think I may know the reason: ...

    I think I may know the reason:

    spiros@lenore:~/programming/cpp.accel.mine$ g++ -v
    Using built-in specs.
    Target: i486-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu...
  5. Replies
    5
    Views
    2,095

    yes, the problem was with "count" I didn't use it...

    yes, the problem was with "count" I didn't use it properly and was concentrating in the for loop to find my mistake rather than looking at other aspects of the program. I've made some modifications...
  6. Replies
    5
    Views
    2,095

    Help with Accelerated C++ exercise

    Hi all,

    I'm working my way through this book and I'm having some trouble in an exercise. It asks to write a program to compute and print quartiles (the quarter of the numbers with largest values)...
  7. Replies
    5
    Views
    2,820

    after couple of days of fiddling with the code, I...

    after couple of days of fiddling with the code, I found out that I was trying to read out of bounds of an array on the last iteration inside a loop.... That's a silly mistake that I shouldn't have...
  8. Replies
    5
    Views
    2,820

    Thanks Elysia, The way I'm allocating 2d...

    Thanks Elysia,

    The way I'm allocating 2d arrays is this:

    arr2d=malloc(rows*sizeof(*arr2d));
    if (arr2d==NULL) {
    printf("Could not allocate data array of size...
  9. Replies
    5
    Views
    2,820

    Passing 2D dynamic arrays

    Hi all,

    Can you please point out to me how can I correctly pass a 2d dynamically allocated array into a function? My problem is that I cannot know the size of the two dimensions beforehand, and I...
  10. Replies
    7
    Views
    2,564

    understood, cheers guys!

    understood, cheers guys!
  11. Replies
    7
    Views
    2,564

    difference between %i and %d

    Hi all,

    I've been debuging a code for almost two weeks now and I found that the problem was the in a fscanf/sscanf statement I used %i instead of %d...

    Can someone please explain to me what is...
  12. Replies
    3
    Views
    3,834

    thanks for your replies. I improved the code,...

    thanks for your replies.

    I improved the code, by initializing all members of the tm structure, and valgrind now shows no errors, but I'm still getting the same behavior at random points in my...
  13. Replies
    6
    Views
    3,014

    Hello! I'm sort of a beginner as well, but can...

    Hello!
    I'm sort of a beginner as well, but can see what is your problem. You correctly initialize the num values with zero. and then:

    num3 = num1 + num2
    which means that num3 holds the value of...
  14. Replies
    3
    Views
    3,834

    memory problem, maybe malloc struct...

    Hi all,
    I'm writing a program to read some experimental data from a file, then do some manipulations, and then to write the new data into another file. The program works ok, but after a few...
  15. Replies
    3
    Views
    5,287

    that's brilliant guys, i've understood what was...

    that's brilliant guys, i've understood what was wrong. Thanks a lot for the explanations of the outputs of sizeof(buff[i]), and sizeof(*buff[i]).

    many thanks
    Spiros
  16. Replies
    3
    Views
    5,287

    malloc 1d string array

    Hi all,
    I'm' writing a program in which I can't get round to see what I am doing wrong in a small part of it that deals with:
    -dynamically allocating a 1d string array (or 2d char array..)...
  17. Replies
    10
    Views
    21,228

    I'm now having another problem with how much...

    I'm now having another problem with how much memory is allocated

    double *vec_y;
    unsigned int nrows;

    vec_y = malloc(nrows*sizeof(*vec_y));
    for (i=0; i<nrows;...
  18. Replies
    10
    Views
    21,228

    I'm just trying to learn by trying different...

    I'm just trying to learn by trying different things. Unfortunately the books I've borrowed from my library are not very clear and therefore things in my head are not clear as well, but fortunately...
  19. Replies
    10
    Views
    21,228

    thanks cas, I'm now trying to get my head round...

    thanks cas, I'm now trying to get my head round what you've posted... pointers are a pain!

    As for the loop going over the columns, that's my mistake being too quick, it should go over "rows"
    ...
  20. Replies
    10
    Views
    21,228

    is it posible to use const int SIZE = 10; int...

    is it posible to use
    const int SIZE = 10;
    int *vector;
    vector = malloc(SIZE*sizeof(vector));
    instead of
    const int SIZE = 10;
    int *vector;
    vector = malloc(SIZE*sizeof(int));?
  21. Replies
    10
    Views
    21,228

    correct malloc use

    Hi all,
    I 'm having a bit of trouble understanding about the use of malloc for 1d and 2d arrays., and I would appreciate if someone could tell me what is correct. Lets say for 1d arrays, which is...
  22. Replies
    6
    Views
    5,838

    ah yes, it's very clear now thank you!

    ah yes, it's very clear now

    thank you!
  23. Replies
    6
    Views
    5,838

    thank you for your replies, it works now. Can...

    thank you for your replies, it works now.

    Can you please explain to me why do I need to call read_data using "data", wheras in the declaration of read_data it's "**data"?
  24. Replies
    6
    Views
    5,838

    passing dynamicaly allocated 2d arrays

    Hi all,

    I'm writing a program where I am allocating a 2d array dynamically (ie using malloc), and then I want to pass this array to a function, but I'm not being successful...

    Here are the...
  25. Replies
    13
    Views
    1,452

    it works! I've split the cout statement into two...

    it works!
    I've split the cout statement into two as you suggested and it worked. Thanks so much, it would've taken me donkeys years to figure this out on my own...

    cheers!
Results 1 to 25 of 55
Page 1 of 3 1 2 3