Search:

Type: Posts; User: mc61

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Thanks to all for your help! CornedBee: I...

    Thanks to all for your help!

    CornedBee: I understand your first method, and I can see how it solves my problem completely! Your second method is a little too much for my elementary level of C++,...
  2. comparing object to a growing set of other objects

    Hello to all,

    In my program I have a set of N vectors (I mean cartesian 3D vectors, represented by C++ vector containers of properly defined structs that I called vectorType). These 3D vectors are...
  3. Replies
    6
    Views
    2,404

    Thanks for all the suggestions. I am just...

    Thanks for all the suggestions. I am just learning how to erase elements from standard containers, together with a few other things you can do with them that I did not know. I think I'll manage.
    ...
  4. Replies
    6
    Views
    2,404

    No, the walkers will exit the tube at a different...

    No, the walkers will exit the tube at a different order than they were created.

    While I have a little experience in C, I am totally new to C++. Could you tell me where I could read about the smart...
  5. Replies
    6
    Views
    2,404

    help with strategy to tackle a project

    Hello,

    I am hoping someone may have a suggestion as to what is the best way to do what I need to do.

    I am writing a program to simulate a physical system. The simplest analogy of what I need to...
  6. Replies
    2
    Views
    1,851

    Thanks matsp! mc61

    Thanks matsp!

    mc61
  7. Replies
    2
    Views
    1,851

    combining boolean conditions with parenthesis

    Hello,

    I was wondering whether the expected parenthesis hierarchy is respected when combining boolean conditions in a do-while loop.

    To be concrete, consider this:


    do
    {
    ...
  8. Replies
    3
    Views
    1,604

    Thanks, Indeed, after I submitted my post I...

    Thanks,

    Indeed, after I submitted my post I found the answer a few threads earlier (and I did search for it before posting...).

    Sorry for the bandwidth, and thanks for the help.

    mc61
  9. Replies
    3
    Views
    1,604

    elementary question on vector and pop_back

    hello,

    I have a little experience with C, and I am trying to learn C++ (brave new world for me!). I have what I am sure is a most basic question. However, I am baffled...

    Say I have the...
  10. Replies
    4
    Views
    2,199

    Thanks guys. As it has happened many times in...

    Thanks guys. As it has happened many times in this board, you clarified a few misconceptions I had.

    mc61
  11. Replies
    4
    Views
    2,199

    help understanding free and memory leaks

    Hello,

    If I understood correctly (and it wouldn't be the first time if I did not), when allocating a local array or struct inside a function one should free it before finishing the function, in...
  12. They are called "escape sequences". ...

    They are called "escape sequences".

    http://www.acm.uiuc.edu/webmonkeys/book/c_guide/1.1.html

    mc61
  13. laserlight and vart, Thank you guys. It seems...

    laserlight and vart,

    Thank you guys. It seems that for my circumstances there may not be a better way to do this (and I will definitely break the loop after the first match).



    Got it. Will...
  14. They array is not sorted, but it could be. Could...

    They array is not sorted, but it could be. Could you tell me what "binary search" is?

    Thanks again,

    mc61
  15. laserlight, Thanks for your reply. You mean...

    laserlight,

    Thanks for your reply. You mean with a "for" loop of some kind? I thought of something like:



    flag = 0;
    for ( j=0; j<N; j++ )
    {
    if ( k == I[j] ) flag = 1;
  16. when an int is not equal to any in a variable group of ints

    Hello,

    In my program I work with a number of 3D objects that move around in space. All these objects are labeled with an index i (within an appropriately defined struct Obj[i] ). For any given...
  17. Replies
    6
    Views
    3,282

    matsp, grumpy, and tabstop, Sorry, my second...

    matsp, grumpy, and tabstop,

    Sorry, my second post crossed paths with grumpy's and tabstop's...

    Thanks! Excellent!! You guys gave me exactly what I was looking for.

    Thanks again,

    mc61
  18. Replies
    6
    Views
    3,282

    Thanks. I thought I was sorting out the issue...

    Thanks.

    I thought I was sorting out the issue of large vs small numbers by using the relative difference. In other words, when one divides by one of the numbers (assuming the other is of the same...
  19. Replies
    6
    Views
    3,282

    numerical precision of a double

    Dear C experts,

    Could anyone tell me what the numerical precision of a double is in C? I read about the smallest and largest numbers I can store in a double, but what I really need to know is how...
  20. dwks, vart, laserlight, Thank you very much...

    dwks, vart, laserlight,

    Thank you very much for all your help. I think I understand now what a wrapper is. Incidentally, after I replied to vart's post I read the article that laserlight...
  21. laserlight: thanks so much for your help and for...

    laserlight: thanks so much for your help and for pointing to the article on mixing C and C++. I'll definitely read it.

    vart: thanks for the suggestion, but I am afraid I have no idea how to do...
  22. You mean like this? pixels = (unsigned...

    You mean like this?



    pixels = (unsigned char*)malloc(3*width*height);


    Sorry if I abuse your kindness with one more thing, but then I take it that you do not see any danger with my...
  23. help with error when compiling a C program with g++

    Hello,

    I have a C program (using OpenGL) that compiles and runs quite well with gcc. Now, to expand it I need to use a library that's written in C++, of which I know nothing.
    I tried simply...
  24. Replies
    5
    Views
    2,239

    Tell me about those OpenGL C++ tutorials... I...

    Tell me about those OpenGL C++ tutorials... I somehow managed to learn from them, but I guess I am too old to learn new tricks :)

    At any rate, your advise worked wonderfully. Here is what I did:...
  25. Replies
    5
    Views
    2,239

    Thank you Elysia, I will try what you told me as...

    Thank you Elysia, I will try what you told me as soon as I can.

    To answer your question about why using global variables, I am implementing sliders and buttons on an OpenGL program, so this is in...
Results 1 to 25 of 31
Page 1 of 2 1 2