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

how to transfer array elements

Hi all...
I declared a matrix ofl arge size as follows:

int (* abc)[128][128][128] = new int[128][128][128];

now I need to transfer all the contents of the above array into another array of same size. How can I do that?

Help needed.

Thanks!!
Jul 6 '07 #1
4 2492
iWillLiveforever
136 100+
Use a for loop and inside the for loop use the number counted as the array spot and that array spot equals the other arrays spot.

Expand|Select|Wrap|Line Numbers
  1. For(int i=0; i<=”number of spots in the array”; i++)
  2. {
  3.     array1[i]=array2[i];
  4. }
That should be correct I’ve been using LUA mostly though so this is my disclaimer and this is for C++ i dont program C so you may have to translate if you are using C.
Jul 7 '07 #2
r035198x
13,262 8TB
Hi all...
I declared a matrix ofl arge size as follows:

int (* abc)[128][128][128] = new int[128][128][128];

now I need to transfer all the contents of the above array into another array of same size. How can I do that?

Help needed.

Thanks!!
Ever heard of the assignment operator?
Jul 7 '07 #3
Thanks a lot.

That was an easy one......i was little bit confused abt other things and messed up the question!!
Jul 7 '07 #4
hmm, what iWillLiveforever has done is basically assign the address of an array to another. i am actually surprised it worked, since the addresses of two arrays cannot be equal. he needs to use pointers in order to do that. maybe i am wrong
Oct 24 '10 #5

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

Similar topics

9
by: Nathan Rose | last post by:
Here's my problem. I am reading from a text file using this: if (!file_exists($file)) { echo "Don't exist\n"; return false; } $fd = @fopen($file, 'r'); if (!is_resource($fd))
8
by: Mike S. Nowostawsky | last post by:
I tried using the "toUpperCase()" property to change the value of an array entity to uppercase BUT it tells me that the property is invalid. It seems that an array is not considered an object when...
5
by: effendi | last post by:
I wrote a simple script to remove an element of an array but I don't think this is the best way to go about it. I have a list of about five elements seperated by ";" I split the array using...
35
by: VK | last post by:
Whatever you wanted to know about it but always were affraid to ask. <http://www.geocities.com/schools_ring/ArrayAndHash.html>
9
by: buda | last post by:
Hi, I've been wondering for a while now (and always forgot to ask :) what is the exact quote from the Standard that forbids the use of (&array) (when x >= number_of_columns) as stated in the FAQ...
11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
3
by: Peter Nofelt | last post by:
On Server.Transfer(), is there a reason why the previous page's elements would appear on the new page? Note: this transfer is occuring between two pages on the same server. <Scenario> I'm using...
17
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hi Gurus, I need to transfer a jagged array of byte by reference to unmanaged function, The unmanaged code should changed the values of the array, and when the unmanaged function returns I need...
1
by: Richard Harter | last post by:
On Fri, 27 Jun 2008 09:28:56 -0700 (PDT), pereges <Broli00@gmail.comwrote: There are some obvious questions that should be asked, e.g., is the contents of your array already sorted as your...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.