Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

size of vector  RSS feed

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what defines the size of the vector,i get two conflicting o/p by the following code,can any one tell me.
thanks for support

 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why should it return 72? You're adding 216 elements to the vector.

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In total agreement with Ulf, 216 elements should be added.
[ April 08, 2008: Message edited by: Gavin Tranter ]
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try to count the number of times you loop :
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!