|
by: |
last post by:
Is it correct to think that after reducing the populated array's size from
say, 10 to 5 with
redim preserve myArray(i)
an attempt to access an element above the fifth does not cause a
compillation error "array out of script", but returns whatever heppened to
be written in that memory address (in particular it might return the correct
values of those elements before re-dimentioning)?
This seems to be the case in my code, yet I wanted to...
|
by: meyousikmann |
last post by:
I am having a little trouble with dynamic memory allocation. I am trying to
read a text file and put the contents into a dynamic array. I know I can
use vectors to make this easier, but it has to be done using dynamic arrays.
I don't know the size of the text file ahead of time, though, so I created a
class that includes a method to resize the array. Here is that class:
class Data
{
public:
Data(int initialsize);
|
by: Peter B. Steiger |
last post by:
The latest project in my ongoing quest to evolve my brain from Pascal to C
is a simple word game that involves stringing together random lists of
words. In the Pascal version the whole array was static; if the input
file contained more than entries, tough.
This time I want to do it right - use a dynamic array that increases in
size with each word read from the file. A few test programs that make use
of **List and realloc( List, blah...
|
by: Tee |
last post by:
Hi,
How do we increase the size of array on runtime and preserve the previous
data?
I don't want to use ArrayList because the array could be a multi-dimension
array.
Thanks,
Tee
|
by: LP |
last post by:
Hello,
What is C# equivalent of rediming an array and preserving exciting elements.
VB.NET syntax looks something like this:
ReDim Preserve myArray(5)
Thank you
|
|
by: John Grandy |
last post by:
Does C# have an equivalent for VB.NET's Redim Preserve ?
ReDim Preserve increases the final dimension of any array while preserving
the array's contents (however, the type of the array may not be changed).
|
by: Paul |
last post by:
Off the cuff, does anyone know if arraylist is more efficeint at adding
items to an array than redim preserve?
Paul
<begin loop>
Dim c As Integer = SomeArray.GetUpperBound(0) + 1
ReDim Preserve SomeArray(c)
SomeArray(c) = SomeObject
<end loop>
|
by: Peter Olcott |
last post by:
I need to know how to get the solution mentioned below to work. The
solution is from gbayles Jan 29 2001, 12:50 pm, link is provided below:
> http://groups.google.com/group/comp.lang.c++/msg/db577c43260a5310?hl
>
>Another way is to create a one dimensional array and handle the
>indexing yourself (index = row * row_size + col). This is readily
>implemented in template classes that can create dynamically allocated
>multi-dimensional...
|
by: doomer |
last post by:
Hello,
I'm trying to build a set of classes that act as the handlers for a
simple expression parser, and i'm wondering how to preserve the
dynamic type information from derived classes. An example will help
illustrate what I have in mind...
class Numeric
{
// contains discriminated union to hold data and identify data
|
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: 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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
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...
|