473,414 Members | 1,598 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,414 software developers and data experts.

Most recent C++ version of similar to VB6 listbox?

SwissProgrammer
220 128KB
It has been discovered, years ago, that in Microsoft Visual Basic 6.0 (with service pack 5) a listbox can handle and also sort over 1,000,000 entries.

What is the most recent version of C++ (NOT using Visual Basic, and NOT using Visual C++, and NOT using .net) code does this? An example please.

Thank you.
May 18 '21 #1
3 5175
Banfa
9,065 Expert Mod 8TB
Erm, I don't quite follow, no version of C++ has a list box; you'd have to include some sort of graphical environment.

Alternatively are you talking about the capacity of the standard containers, i.e. std::list. They have a method that returns there maximum capacity std::list::max_size. This is theoretical so you normally get a value of max signed/unsigned 32/64 bit integer**. The actual capacity of of a std::list is dependent on both how much memory is available and the size of the object it is storing.


** I assume it returns this in all cases, I don't find it to be a very useful method so I rarely call it and I certainly haven't called it on a list with a data type that is very large and therefore may allow a calculation of actual max size given available memory and data type size which is possible.
May 19 '21 #2
SwissProgrammer
220 128KB
Banfa, thank you.

Searching for std::list which you mentioned, I found https://www.guru99.com/cpp-list.html .

Then https://en.cppreference.com/w/cpp/container/list .

Then https://en.cppreference.com/w/cpp/container/list/sort .

Then https://www.cplusplus.com/reference/list/list/sort/ .

It looks like using std::list is maybe more versatile than using vector.

And C++ seems to have packaged a lot of code into std::list that I now do not have to write.

Thank you Banfa.

Comments?

Observations that I might have missed?

Applications that I might find useful?
May 26 '21 #3
Banfa
9,065 Expert Mod 8TB
I used to use https://www.cplusplus.com a lot but it seems to have given up at C++11, I used to use https://en.cppreference.com a bit but have started using it more since cplusplus gave up because it adds data for each new version of the standard.

It sounds a bit like you are unfamiliar with the standard containers https://en.cppreference.com/w/cpp/container. It is worth familiarising yourself with them and particularly their differences so you can choose the right one.

The rule of thumb that I (and others) use is your default choice should be the vector; only use a different container if you have a valid conveyable reason why you need to that type rather than the vector (needing to sort would a good reason to use std::list over std::vector, sorting a vector is slow)

Early on std::set tripped me up a couple of times because I put data in one and then wanted to change it but couldn't. That is correct behaviour for a set because a set is an ordered collection of keys, they have to be immutable because changing the value of a key would necessitate re-ordering the set.

I would say over 15-20 years the containers I use most are std::vector, std::list and std::map. I have use std::deque occasionally but in truth I am hard pressed to give you a good reason to use that instead of std::list. I've also used the std::queue container adaptor.
May 26 '21 #4

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

Similar topics

7
by: Nova's Taylor | last post by:
Hi folks, I am a newbie to Python and am hoping that someone can get me started on a log parser that I am trying to write. The log is an ASCII file that contains a process identifier (PID),...
3
by: Suresh Kumaran | last post by:
How do you program in VB.NET to show the most recent used document in a dropdown menu? I am referring to something like in MS WORD or EXCEL where it shows the recent document the user was working...
0
by: shawnk | last post by:
I downloaded and installed the new SQL Server Express Manager tool but it had problems with the latest 'released version of .NET (version I have is 2.0.40607). I looked on MSDN websites but did...
1
by: getyourbiglobster | last post by:
hello- i have a sample database that i want to query for most recent SAMPLE, min SAMPLE_RESULT, and max SAMPLE_RESULT. the table is orgainzed as such: SAMPLE | SAMPLE_DATE | SAMPLE_TIME |...
1
by: Eric Del Sesto | last post by:
I tried the VC++2005 Express beta today and found so many errors in the documentation and sample files that I realized I needed to go back to the most recent released IDE, and purchased VC++ .NET...
2
by: rubikzube* | last post by:
I'm new to mysql and I was wondering if I could trouble some of you for help. I have a table in my database that may contain multiple versions of the same element as different rows. I wanted to...
4
by: Lee | last post by:
I have an application where I need to find the most recent file placed in a folder. For example, my users periodically place an image file with the format "ImageXXXX.jpg" (where XXXX is some...
2
by: robert.waters | last post by:
I need to perform the following: - select the most recent X number of records in a table (there is a timestamp field) - select the Nth occurrence of X number of records ex: - most recent 10...
4
by: zacks | last post by:
Most applications whose purpose is to work with various types of files implement a "Most Recent Files" list, where the last, say, four files accessed by the application can quickly be re-opened by...
1
by: lutz | last post by:
I fully admit, I am begging for some help. I am at the mercy of anyone's generous nature. I wish I had a template to follow for this one. I thank you in advance for anyone's advice. Maybe...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.