PDA

View Full Version : QVECTOR abnormally terminating the program



Nishant
15th October 2010, 19:37
Hello,
I wanted to create a QLabel array ...so i created a QVECTOR ..but the program terminates abnormamlly...
where am i wrong??
Thanks

tbscope
15th October 2010, 19:44
Do you understand what a pointer is and that you can't use an uninitialised pointer?

Nishant
15th October 2010, 19:48
Yes...i do know i cant use an unitialised pointer..but can you please tell me where i am doing that..i am using vectors for the first time
thanks

Nishant
15th October 2010, 19:57
ok...got that...i added a line for the vector l...but now its terminating when i click the add button.it says index out of range...nd why is that?
Thanks

Nishant
15th October 2010, 20:35
ok...m uploading the updated code...but the ADD button is not working....someone please help me out...

ChrisW67
15th October 2010, 21:19
Have you run the program in a debugger to find exactly where it crashes or breaks?
Did you take any notice of the warning your compiler probably produced during compilations? GCC produces:


frame.cpp: In member function ‘void frame::t1changed()’:
frame.cpp:38: warning: ‘i’ may be used uninitialized in this function

Why might i be uninitialised here?
What do you think that declaring a local variable int i inside a for() loop using i as its index will do?

Nishant
16th October 2010, 16:15
Thanku everyone....resolved it nw..:)