Why my "i" counter doesn't increases?
-
The cycle i made should work for three times, for the first time in the debug the "i" counter increses from zero to 1, as i see on the second time "i" counter doesn't increases!!! But it have to! I can't understand... Here is the code:
for(int i =0;i<ColumnsNumber;i++) { //Reading Column Definition DBFColumn column; dbffile.read(column.FieldName,10); dbffile.read((char*)&column.caPad,sizeof(char)); dbffile.read((char*)&column.cFieldType,sizeof(char)); dbffile.read((char*)&column.lwhere,sizeof(int)); dbffile.read((char*)&column.cFieldLength,sizeof(char)); dbffile.read((char*)&column.cFieldPrecision,sizeof(char)); dbffile.read((char*)&column.caPad3,14); /*for(int j= 0;j -- modified at 2:57 Wednesday 15th February, 2006
-
The cycle i made should work for three times, for the first time in the debug the "i" counter increses from zero to 1, as i see on the second time "i" counter doesn't increases!!! But it have to! I can't understand... Here is the code:
for(int i =0;i<ColumnsNumber;i++) { //Reading Column Definition DBFColumn column; dbffile.read(column.FieldName,10); dbffile.read((char*)&column.caPad,sizeof(char)); dbffile.read((char*)&column.cFieldType,sizeof(char)); dbffile.read((char*)&column.lwhere,sizeof(int)); dbffile.read((char*)&column.cFieldLength,sizeof(char)); dbffile.read((char*)&column.cFieldPrecision,sizeof(char)); dbffile.read((char*)&column.caPad3,14); /*for(int j= 0;j -- modified at 2:57 Wednesday 15th February, 2006
Rassul Yunussov wrote:
for(int i =0;i<ColumnsNumber;i++)
what is the value of
ColumnsNumber
Owner drawn Jesus Loves
-
Rassul Yunussov wrote:
for(int i =0;i<ColumnsNumber;i++)
what is the value of
ColumnsNumber
Owner drawn Jesus Loves
-
The ComunsNuber is 3, but my cycle runs more than 3 times, because the "i" counter doesn't increases!!! I Can send you the solution in archive, give me you e-mail. And You'll see. The solution is on visual studio 2005 professional
-
The ComunsNuber is 3, but my cycle runs more than 3 times, because the "i" counter doesn't increases!!! I Can send you the solution in archive, give me you e-mail. And You'll see. The solution is on visual studio 2005 professional
-
The cycle i made should work for three times, for the first time in the debug the "i" counter increses from zero to 1, as i see on the second time "i" counter doesn't increases!!! But it have to! I can't understand... Here is the code:
for(int i =0;i<ColumnsNumber;i++) { //Reading Column Definition DBFColumn column; dbffile.read(column.FieldName,10); dbffile.read((char*)&column.caPad,sizeof(char)); dbffile.read((char*)&column.cFieldType,sizeof(char)); dbffile.read((char*)&column.lwhere,sizeof(int)); dbffile.read((char*)&column.cFieldLength,sizeof(char)); dbffile.read((char*)&column.cFieldPrecision,sizeof(char)); dbffile.read((char*)&column.caPad3,14); /*for(int j= 0;j -- modified at 2:57 Wednesday 15th February, 2006
I can't see anything in your code that would cause that problem. Are you sure the value of
ColumnsNumber
is what you expect? Also, check to make sure your sizes in thedbffile.read()
calls are correct - you might be encountering a memory smashing bug.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
-
The cycle i made should work for three times, for the first time in the debug the "i" counter increses from zero to 1, as i see on the second time "i" counter doesn't increases!!! But it have to! I can't understand... Here is the code:
for(int i =0;i<ColumnsNumber;i++) { //Reading Column Definition DBFColumn column; dbffile.read(column.FieldName,10); dbffile.read((char*)&column.caPad,sizeof(char)); dbffile.read((char*)&column.cFieldType,sizeof(char)); dbffile.read((char*)&column.lwhere,sizeof(int)); dbffile.read((char*)&column.cFieldLength,sizeof(char)); dbffile.read((char*)&column.cFieldPrecision,sizeof(char)); dbffile.read((char*)&column.caPad3,14); /*for(int j= 0;j -- modified at 2:57 Wednesday 15th February, 2006
-
The ComunsNuber is 3, but my cycle runs more than 3 times, because the "i" counter doesn't increases!!! I Can send you the solution in archive, give me you e-mail. And You'll see. The solution is on visual studio 2005 professional
-
The ComunsNuber is 3, but my cycle runs more than 3 times, because the "i" counter doesn't increases!!! I Can send you the solution in archive, give me you e-mail. And You'll see. The solution is on visual studio 2005 professional
Rassul Yunussov wrote:
...but my cycle runs more than 3 times...
How are you verifying this?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
-
Rassul Yunussov wrote:
...but my cycle runs more than 3 times...
How are you verifying this?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
well, shame on me. I found the problem... I was reading the data to the pointer, that i didn't reserved in the memory. So i erased the memory where "i" was stored.