hello!after more than an hour of fcuking with dynamic arrays i did what you said, and it worked fine. and all this time i thought my compiler has gone nuts,by not understanding the basic...
Type: Posts; User: kotzy
hello!after more than an hour of fcuking with dynamic arrays i did what you said, and it worked fine. and all this time i thought my compiler has gone nuts,by not understanding the basic...
i don't understand. in which occurence can an error flag be expected?
i ran the program with three different files,and each produced a correct minimum spanning tree with prim's algorithm.i helped...
thanks swoopy! now it works fine!
here is the final code. it's altered a bit.
int stev;
while (!Graf.eof()) {
Graf>> stev; // reads numbers
if (stev == -1) Matrika[j][i] = 10000; // if...
i got it! and it almost works fine!
content of my file:
-1,55,25,45,-1,-1,-1,-1
55,-1,-1,-1,5,-1,-1,-1
25,-1,-1,-1,40,-1,-1,-1
45,-1,-1,-1,20,-1,-1,30
-1,5,40,20,-1,35,15,-1...
though i have problems with files and streaming, i managed to write this code. but that only reads numbers if there are ONLY numbers in a file. Well, the data in my text file represents kind of a MxM...