473,396 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

List iteration Problem

Hi All,

I am using list class in my project(MFC Application). I have made list like .....

typedef std::list rectlist; // Here list is of type RECT

in one header file. And during my project execution I am storing rectangles in the list.

And now,When I use list iterator in another class like below....( I have already included its header file in using class)

rectlist::iterator i;

And i use this iterator like below in any other function......

for (i = rects.begin(); i != rects.end(); i++)
{
CaptureScreen(*i, m_mainbuff); // Error is here
}

I got error msg like ...

list iterator not dereferencable

at runtime in debug assertion Failed Box.

Thanks in Advance...

Ashish
Oct 16 '07 #1
1 1626
weaknessforcats
9,208 Expert Mod 8TB
typedef std::list rectlist; // Here list is of type RECT
Shouldn't this be:
Expand|Select|Wrap|Line Numbers
  1. typedef std::list<RECT> rectlist; // Here list is of type RECT
  2.  
???

It looks like you have typedef'd the the list container itself rather than typdef'd a list of RECT objects.
Oct 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

25
by: skull | last post by:
Hi everybody, it is my first post in this newsgroup. I am a newbie for python though I have several years development experience in c++. recently, I was stumped when I tried to del item of a list...
4
by: spike | last post by:
I've googled like crazy and can't seem to find an answer to why this isn't working. I want to create a custom list class that acts as a circular list. ie: my_list = (0, 1, 2) how I want it...
7
by: silverburgh.meryl | last post by:
in STL, why vector has an API to return the n-th element, but list does not have such API? http://www.sgi.com/tech/stl/Vector.html http://www.sgi.com/tech/stl/List.html Thank you.
15
by: Macca | last post by:
Hi, My app needs to potentially store a large number of custom objects and be able to iterate through them quickly. I was wondering which data structure would be the most efficient to do this,a...
12
by: Danny Colligan | last post by:
In the following code snippet, I attempt to assign 10 to every index in the list a and fail because when I try to assign number to 10, number is a deep copy of the ith index (is this statement...
10
by: AZRebelCowgirl73 | last post by:
This is what I have so far: My program! import java.util.*; import java.lang.*; import java.io.*; import ch06.lists.*; public class UIandDB {
15
RMWChaos
by: RMWChaos | last post by:
As usual, an overly-long, overly-explanatory post. Better too much info than too little, right? A couple weeks ago, I asked for some assistance iterating through a JSON property list so that my...
4
RMWChaos
by: RMWChaos | last post by:
The next episode in the continuing saga of trying to develop a modular, automated DOM create and remove script asks the question, "Where should I put this code?" Alright, here's the story: with a...
5
by: Christopher | last post by:
The situation is that a std::list<std::set<std::string is being iterated through. Upon certain criteria some sets become empty. I need to remove the empty sets from the list. Is it safe to...
0
by: Javier | last post by:
Hi all, I have this code: class A { std::list<Bm_observadores; void function() {
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.