Search:

Type: Posts; User: smokeyangel

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    560

    Or in fact, the GNU compiler manual, for inline...

    Or in fact, the GNU compiler manual, for inline assembly :)

    I guess you're trying to write a sequence of plain assembly instructions (i.e. unquoted, without asm()) in a C/C++ file.

    I don't...
  2. Replies
    10
    Views
    741

    Ah, never mind, I see you've got another thread...

    Ah, never mind, I see you've got another thread open about compiler errors. You really should post what the error messages are!
  3. Replies
    10
    Views
    741

    The obvious errors would be that you haven't...

    The obvious errors would be that you haven't defined sol[][] or solveMaze(). I didn't get anything else.

    That aside, this looks good. It solves the maze you've given, and removes markers from dead...
  4. The other popular way of handling this is to use...

    The other popular way of handling this is to use fgets to read the whole input line into a buffer. Provided the buffer is large enough, you'll get anything before and after the number, as well as the...
  5. Replies
    10
    Views
    741

    You say you got the wrong result -- I have no...

    You say you got the wrong result -- I have no idea how you managed to wrestle a compiler into compiling this! It's not that there are a lot of mistakes, just a couple that you really can't away with...
  6. I've decided it shouldn't be there, but I'll...

    I've decided it shouldn't be there, but I'll explain what I was thinking anyway:

    Initially my version of the program let you put whitespace in the expression, like "1 + 2 + 3". scanf would be a...
  7. Ahaa - I just saw your other thread. My previous...

    Ahaa - I just saw your other thread. My previous reply was really just about getting this code working, and won't help with operator precedence at all.

    It might help a bit with tokenisation...
  8. Ok. Since you're learning, I've kept it pretty...

    Ok. Since you're learning, I've kept it pretty similar to your code, so it doesn't throw a bunch of new concepts in. The resulting code is pretty fragile (will not work if you, for example, input a...
  9. I keep looking at that equation and trying to...

    I keep looking at that equation and trying to figure out how to use it to travel back in time.

    Anyway, yes, that's right. Just plug in the numbers to solve for time. I think it means the total...
  10. Good advice from Matticus. You're on the right...

    Good advice from Matticus.

    You're on the right track -- quite a few bugs and stuff to work out but it's the right idea.

    On the subject of splitting strings.... I don't think that's the right...
  11. while (inch

    while (inch<=MAX);


    Look. Look closely.... :) There's a semicolon there when there shouldn't be. This means:



    while (inch<=MAX)
    ; // do nothing
    <some more code that won't get...
  12. Replies
    9
    Views
    3,456

    With "r+" the file is required to exist before...

    With "r+" the file is required to exist before fopen is called -- is that what you want? "a+" will create it if it doesn't exist already, but won't clear an existing file.

    I prefer not to keep...
  13. Replies
    2
    Views
    552

    ssize_t is signed, so the loop will correctly not...

    ssize_t is signed, so the loop will correctly not run if size=1.

    On the code....
    You seem to be missing a parameter for size in your write() function, but other than that it seems to work.

    ...
  14. Replies
    4
    Views
    581

    +1 for stepping through it in a debugger. Always...

    +1 for stepping through it in a debugger. Always helpful.

    I'm guessing that it's the recursion in compute_val that is causing confusion. Note that get_val isn't called at all until compute_val has...
  15. Oh dear :(. No, not exactly ok or sober. It's a...

    Oh dear :(. No, not exactly ok or sober. It's a long story, but I have a few broken ribs and am so doped up I can barely see the keyboard.

    My apologies - had I realised that this had been noticed...
  16. Oh no! I'm really sorry, that was just a typo!! I...

    Oh no! I'm really sorry, that was just a typo!! I meant:



    fprintf(out,"%lf %lf %lf",cam->view_point.x,cam->view_point.y,cam->view_point.z);


    Sorry about that. I was staring and staring at...
  17. Yrah, you're right, I retract my advice about...

    Yrah, you're right, I retract my advice about using %f. It'll work, but as a rule I try to avoid sneaky implicit casts. Control freak.....

    I read a while ago that %f was float and for double, and...
  18. Um. Ok. I don't know where to start. Ok. ...

    Um. Ok. I don't know where to start.
    Ok.

    Your structuires are indeed structures, and I have nothing bad to say about them,

    However (I really do try to be nice) that fscan call is an...
  19. By vector, do you mean array, or some other sort...

    By vector, do you mean array, or some other sort of structure? I would not like to see what scanf() would do to a c++ vector. Probably give it its best shot and blow up your program.
  20. Replies
    1
    Views
    649

    Yeh, you have some truncaiton-to-integer issues...

    Yeh, you have some truncaiton-to-integer issues here:


    int temp;
    for (int e = 0; e < SIZE-1; e++)
    {
    for (int j = e+1; j < SIZE; j++)
    {
    if (arr2[e]...
  21. Heh - a few years ago I heard on the grapevine...

    Heh - a few years ago I heard on the grapevine that Microsoft had finally bracked and decided to support C11 (I don't mean C++11). Ot was the most reliable friend so I went on the net and found pages...
  22. Replies
    8
    Views
    631

    Ok -- what I was getting at, is that there's...

    Ok -- what I was getting at, is that there's going to be more than one unction that needs access to the array. Unless you plan to populate the array in display() too. Nasty!

    So you need to...
  23. No, no difference at all when tested on MSVC...

    No, no difference at all when tested on MSVC compiler at max optimisation.

    Here's the disassembly of your first snippet:


    char* test1(void) {
    push ebp
    mov ebp,esp
    sub ...
  24. Replies
    3
    Views
    772

    Interesting topic!! I'd never heard of...

    Interesting topic!!

    I'd never heard of "simulated annealing" before today. So I'm not really qualified to give you advice there.....

    Programming-wise:

    1. You're using integer literals...
  25. Replies
    39
    Views
    1,450

    I'm afraid your question isn't clear enough -- I...

    I'm afraid your question isn't clear enough -- I just don't know what you're asking!

    I gather from your original post that you aren't quite sure what you're asking either -- so could you describe...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4