|
by: Michael B. Allen |
last post by:
Coming from C and Java on *nix I'm a little out of my element messing around
with CList and MSVC++ but I think my issues are largely syntactic.
I have an ADT that I use called a 'varray' that can return a pointer to an
arbirary sized element in an array given an index and it will allocate the
memory to back it if necessary:
struct varray *tests = varray_new(sizeof(struct test));
struct test *t = (struct test *)varray_get(tests, 50));
|
by: Riadh Elloumi |
last post by:
Hi,
I have some problems when debugging memory allocation (for both malloc
and new) in a program that uses standard lists and vectors. When I add
an element to the vector, the overloaded "delete" operator is called
somewhere in the STL library and it cannot find the allocated memory.
How can I avoid this problem ? Can I overload new and delete only in my
code and not in the STL?
You can see my problem by compiling the mem.cpp joined...
|
by: Emanuel Ziegler |
last post by:
Hi,
I am using the vector class from the STL. Normally, I initialize values
element by element, which is very uncomfortable and sometimes impossible
(e.g. when passing a constant vector to an inherited constructor, since I
cannot create a temporary vector before calling).
Is there a possibility to assign a vector in one line, like it is possible
for arrays?
|
by: eriwik |
last post by:
I use the following structure to store filenames for one or more "sets"
grouped together by a number:
map<int, map<string> > fileSets;
As arguments to the constructor I send a vector<vector<string> > where
each vector<string> contains the filenames of one set. The function
getNumber() calculates a number from the filename. The constructor then
looks like this:
|
by: syang8 |
last post by:
hi, folks,
I use Kdevelop to build some scientific simulation on Linux. If I set
the size of an array N = 8000, the program works fine. However, if I
set the array N some number greater than 10000 (actually, what I need
is 80000), the program has segmentation error. The intersting thing is
that the positions reporting segmentation error are different if I set
N to be different values.
What problem is this usually? I guess must be...
|
|
by: jayharris |
last post by:
I'm having a ton of trouble initializing a multi-dimensional array
inside a constructor, largely because I don't know the size of the
array until runtime. I have a class that looks like this:
class MyClass
{
public:
const int size;
MyClass( const int );
};
|
by: mast2as |
last post by:
Hi everyone
I am working on some code that uses colors. Until recently this code
used colors represented a tree floats (RGB format) but recently changed
so colors are now defined as spectrum. The size of the vector went from
3 (RGB) to 151 (400 nm to 700 with a sample every 2nm). The variables
are using a simple Vector class defined as follow:
template<typename T, int Depth>
class Vector
|
by: liuhaoran |
last post by:
HI. i have a question about memory error.
when i change double variable to float variable ,for example:
int curGen = 0;
double sum = 0;
// m_iPopSize is int variable ,NewPop is a vector
int NumToAdd = m_iPopSize - NewPop.size();
|
by: zacariaz |
last post by:
The subject isnt very clear, but ill do my best to explain.
In a class in need a bitset which size is defined by the constructor,
e.g. something like this:
class Example {
std::bitset<?>Bs;
public:
Example(int input) {
? = input;
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|