![]() |
|
#1
|
|||
|
|||
need help with some c++ coding..i'm suppose to write out a program to convert a text file to a format whereby "Fly" program can read and draw the picture..
But it cant seem to be able to read properly from my text file or what coz when it draws the picture out it get abit distorted.. Here's my program: CPP / C++ / C Code:
Example for the data in the text file: 0 chr1 4557 4904 chr18 26128641 26128969 - 3997 1 chr1 5633 5822 chr18 26133554 26133742 - 6940 2 chr1 6710 6961 chr18 26136897 26137149 - 9591 3 chr1 7091 7238 chr18 26138722 26138869 - 8464 4 chr1 7458 7670 chr18 26138937 26139141 - 7255 5 chr1 7767 7942 chr18 26139575 26139746 - 7143 Last edited by LuciWiz : 03-Dec-2004 at 03:42.
Reason: Please insert your c code between [c] & [/c] tags
|
|
#2
|
|||
|
|||
|
change my program abit
the picture that this program will draw http://www.geocities.com/llxxivanxxll/pic.zip CPP / C++ / C Code:
|
|
#3
|
||||
|
||||
|
Have you tried running it through the debugger? You really need to be more specific as to what your problem is, and instead of supplying your entire source code, give us the code that pertains to the problem and let us know what kind of errors (assuming these are logic errors, not compiler errors) you are running into. If I were you, I'd be looking at the data as it is read from the file and before it undergoes the conversion that you are performing. Do a step by step and watch it perform each task at least once so that you can understand what is happening to the data as it is processed.
On a side note, I noticed that you are not testing most of your file I/O to see if it succeeded. While Stream I/O does protect you a bit more than low level and standard I/O, you still absolutely need to check to see if a file operation succeeded before you process any data. As I have said in a previous file I/O thread, a program that fails to test ALL file I/O operations is doomed to fail. __________________
-Aaron |
|
#4
|
|||
|
|||
|
ohh anyway i manage to get it running now....
thx aaroncohn for the advice... anybody noe how to do filtering/windowing to filter out the data i want?? |
|
#5
|
|||
|
|||
Need Help Again!! how do i pass the data from this beginNum & endNum to CPP / C++ / C Code:
this function's beginNum & endNum?? CPP / C++ / C Code:
|
|
#6
|
||||
|
||||
|
You must pass the address of the variables.
The function call would look like... CPP / C++ / C Code:
__________________
-Aaron |
|
#7
|
|||
|
|||
|
hmm got abit of prob doing that.... but nvm i put tat calculation part into the same function....
But now i got 1 prob.. when i use the calculate = endNum-beginNum den when it check and loop but its not wat i wanted.... so how can i make sure that the para3=.......beginNum & endNum is the 1 i wanted from calculate=endNum - beginNum?? CPP / C++ / C Code:
|
|
#8
|
||||
|
||||
|
Sorry, I'm not sure what you're trying to do with the function, nor am I seeing any kind of a loop. You did mention a loop, didn't you?
__________________
-Aaron |
|
#9
|
|||
|
|||
|
well u see i need to calculate the difference between the endNum and the beginNum then i need to see if it's more then 50% if it is i will then draw a line..If it's lesser den 50% i dun draw...
overall i need to filter the result then draw a line... below is basically what i use to draw rectangle and line.. CPP / C++ / C Code:
But the if(calculate>=600) got some prob.. it end up filtering away those lines that is less then 600, but if i change the 600 to 400 it end up drawing all the lines. sorry if u don't understand what i'm talking about.... |
|
#10
|
|||
|
|||
need serious HELP here!!for example i set para as color and print out the color
CPP / C++ / C Code:
then now i want to put in a switch/if loop to change the para6,7,8 how do i do it??? got different color.. ![]() |
Recent GIDBlog
2nd Week of IA Training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help with coding expectation maximization needed. thanks | edge | C Programming Language | 8 | 08-Nov-2005 05:00 |
| PHP/MySQL coding issue | cmarti | MySQL / PHP Forum | 3 | 26-Jul-2004 08:01 |
| Need a little coding help | dabigmooish | C Programming Language | 5 | 27-May-2004 23:37 |
| Pls help in this coding. | harsha | CPP / C++ Forum | 5 | 08-Apr-2004 20:48 |
| coding a word with a givin factor | funnyf | CPP / C++ Forum | 2 | 13-Jan-2004 08:32 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The