Search:

Type: Posts; User: GeorgeV

Search: Search took 0.01 seconds.

  1. Replies
    23
    Views
    3,395

    But, doesn't x also only exist within the scope...

    But, doesn't x also only exist within the scope of the outer for loop? Plus, height is called after this loop too.

    Good point Robatino, no I did not.

    Forgive my ignorance, and apparent lack of...
  2. Replies
    23
    Views
    3,395

    Here's the full code, as it is at the moment....

    Here's the full code, as it is at the moment. Doesn't matter what x and y values are, still produces the same error.



    #include <cstdlib>
    #include <iostream>
    #include <iomanip>
    #include...
  3. Replies
    23
    Views
    3,395

    Ok, I did try that, and here's why it didn't...

    Ok, I did try that, and here's why it didn't work.

    I get the error: "name lookup of 'y' changed for new ISO 'for' scoping" :(

    (using Dev C++ by the way.)
  4. Replies
    23
    Views
    3,395

    I thought it was that simple, but then I'm sure I...

    I thought it was that simple, but then I'm sure I did try that already.

    Probably just missed off the ; or something stupid.

    Cheers.
  5. Replies
    23
    Views
    3,395

    Again, thanks for the help. I'm now using ...

    Again, thanks for the help. I'm now using <cmath> instead, and at the moment I'm also using references. So this bit reads something like so:



    void height (float & x, float & y)
    {
    x = x...
  6. Replies
    23
    Views
    3,395

    Thanks everybody for all the tips! Re the...

    Thanks everybody for all the tips!

    Re the "hash" key: I can't find it on this keyboard. It's pictured on the '3' key, but this only gives the '£' sign when combined with 'Shift'.

    Next to the...
  7. Replies
    23
    Views
    3,395

    Math function deg/rad query

    I've gone and got myself confused with this little program :( It's meant to find the height of a triangle in degrees, when the angle of elevation (y) and the distance accross (x) is known, and output...
  8. Replies
    6
    Views
    1,590

    Hah! I had that figured out earlier today, but it...

    Hah! I had that figured out earlier today, but it wouldn't work. So it turns out I had the brackets all wrong - I only had one set enclosing the entire equation.

    Thanks guys
  9. Replies
    6
    Views
    1,590

    Sorry, missed the last part of your comment. ...

    Sorry, missed the last part of your comment.

    If all else fails I'll do that. Good idea.
  10. Replies
    6
    Views
    1,590

    Thanks for the prompt reply. Yes that would...

    Thanks for the prompt reply.

    Yes that would be somewhat easier, but the requirements for this assessment state that a Switch statement must be used. I tried a combination of Switch and 'else if',...
  11. Replies
    6
    Views
    1,590

    Switch statement help

    Hey guys, I've been mucking around with this or hours, to no avail. Hope you can help.

    Basically, how the crap can I shorten this block of code? It works just fine how it is, but I've been assured...
Results 1 to 11 of 11