Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 164041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:40:26+00:00 2026-05-11T11:40:26+00:00

let say i have that Structure myStruct Public myPoint As Point Public myBool As

  • 0

let say i have that

Structure myStruct     Public myPoint As Point     Public myBool As Boolean End Structure 

how to I make a copy / clone of that structure?

I fixed that issue now, example of the code I was using:

    Dim myStruct(1) As myStruct      myStruct(0).myPoint = New Point(10, 10)     myStruct(0).myBool = True      Dim myCopy(1) As myStruct     myCopy = myStruct     myCopy(0).myBool = False     myCopy(0).myPoint = New Point(11, 11) 

with that, both variable was changed

I had to do

    myCopy = CType(myStruct.Clone, myStruct()) 

and another question, if that structure is used, let say, 10,000 times, should I created a class instead?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T11:40:26+00:00Added an answer on May 11, 2026 at 11:40 am

    You’re looking at 12 bytes per structure, so passing it around as a struct is cheaper than creating a word-sized reference to it on heap (in other words, using a class)

    If you need to access all 10,000 at once, creating an array of them will happen on the heap even if they are structs.

    Copying the struct is as easy as creating declaring another struct of the same type and assigning the first to the second.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a structure named vertex with a method that adds two
Let's say we have a class that looks like this: class A { public:
Let's say I have a class structure that is defined below: Class Item(models.Model): ...
Let say that I have 2 tables with the same structure : STOCK and
Let's say I have the following class structure: class Car; class FooCar : public
Let's say we have a structure like so: Try ' Outer try code, that
let's say that I have structure like this : As most you may see
Let's say that I have an adt representing some kind of tree structure: data
Let's say we have an entity that has attributes att1 and att2, where att1
Let's say I have a date that I can represent in a culture-invariant format

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.