![]() |
|
#1
|
|||
|
|||
Bezier curve.My code has no errors or warnings but it just closes after asking for the values for w, and i have no clue y. Im trying to work out the coordinates on a bezier curve, the maths is fine i think but the code just doesnt work like i want it to.
CPP / C++ / C Code:
|
|||
|
#2
|
||||
|
||||
|
Warny, you may want to repost your code if you fixed the problem and are still having problems with something else. I see several things that look wrong in this program, but I don't want to comment on something that you already fixed.
![]() |
|
#3
|
||||
|
||||
|
And be specific. "It doesn't do what I want it to" is not a problem. What it does do is, as well as what it's supposed to do. Both these are needed for a solution.
|
|
#4
|
|||
|
|||
|
Here's a suggestion whenever your program doesn't give the answers that
you expect: Every time you obtain input values (from user console input or from a file), print out their values. For example: CPP / C++ / C Code:
Note that using scanf() requires the user to input the data exactly as indicated in the specificaton. So, for example, the user must enter integer values separated by commas in each case. I am sure that your if( ) condition is not doing what you had in mind, but: first things first. Verify the input! Dave |
|
#5
|
|||
|
|||
|
My code works perfectly now i managed to fix my problem, which as i didnt state it b4 was the fact that i wasnt given any output for values of x and y. Now when i print the values of x and y i get the output:
x1 y5 x2 y6 x3 y7 whereas id prefer the numbers for the y values to b y1,y2,y3. Is there any way of doing this. CPP / C++ / C Code:
|
|
#6
|
||||
|
||||
|
Quote:
Also, did you mean to double index your for loop? (you are incrementing by 0.4 each time you go through the loop CPP / C++ / C Code:
|
|
#7
|
|||
|
|||
|
Well, I claim that if the output doesn't look like you want it to, that the "code" isn't working "perfectly". (Just my little attempt at humor; but, seriously, output is an important part of the code --- actually it is (usually) the only thing that the user sees.)
You want to print the results for what value(s) of u? As a debugging aid, I suggest the following: In place of your statement CPP / C++ / C Code:
I suggest you put CPP / C++ / C Code:
and see if it's really what you want. Similarly, for the y value, try CPP / C++ / C Code:
Tell us how it turns out. Regards, Dave |
|
#8
|
|||
|
|||
|
Quote:
|
|
#9
|
||||
|
||||
|
Quote:
I don't know about the rest of you, but I'd prefer posts are written in English as opposed to lazy-geek-ish. English will be required when you get into the business sector for communication, so you might as well learn it now. Also, my brain won't hurh trying to translate messages. |
|
#10
|
||||
|
||||
|
Yeah, honestly, I think it's appalling how many people use such bad grammar and spelling when communicating over the internet. It's still communication, and the person on the other side is still going to get the idea that you can't speak english.
|
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The