473,666 Members | 2,065 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Store an array to an integer array??

Hi all:

Is it possible to store an integer array to another integer array?
Or should I use an array of pointers that will point to a particular
array?

Thanks for the help.

Dec 11 '06 #1
7 2725
rh*******@gmail .com writes:
Is it possible to store an integer array to another integer array?
Do you mean an array of integer arrays? Just like this:
int x[2][3];
Or should I use an array of pointers that will point to a particular
array?
What are you trying to do?
--
int main(void){char p[]="ABCDEFGHIJKLM NOPQRSTUVWXYZab cdefghijklmnopq rstuvwxyz.\
\n",*q="kl BIcNBFr.NKEzjwC IxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+= strchr(p,*q++)-p;if(i>=(int)si zeof p)i-=sizeof p-1;putchar(p[i]\
);}return 0;}
Dec 11 '06 #2

What are you trying to do?
--
For example, I have 4 integer arrays with size 4:

my_array1, my_array2, my_array3, my_array4..
each array will contain 4 integers..

Now I would like to store these 4 arrays in anothe location because I
would like to print them later on.. Can I store them in anothe array?
or should I create an array that points to them?
thanks..

Dec 11 '06 #3
rh*******@gmail .com wrote:
Hi all:

Is it possible to store an integer array to another integer array?
If they're of the same type and size, then yes.
Or should I use an array of pointers that will point to a particular
array?
Can't say unless you tell us what you're trying to do. In programming
there're, usually, many ways to accomplish something. What is most
suitable depends on the details of the specific program and it's
environment.

Dec 11 '06 #4
rh*******@gmail .com wrote:
What are you trying to do?
--

For example, I have 4 integer arrays with size 4:

my_array1, my_array2, my_array3, my_array4..
each array will contain 4 integers..

Now I would like to store these 4 arrays in anothe location because I
would like to print them later on.. Can I store them in anothe array?
or should I create an array that points to them?
If your arrays are local and the code to print them will be elsewhere
in scope then you'll need to store these arrays somewhere else, just
pointing to them will not be enough.

If they're dynamically allocated or declared static or global then
holding pointers to them is sufficient.

Dec 11 '06 #5

Can't say unless you tell us what you're trying to do. In programming
there're, usually, many ways to accomplish something. What is most
suitable depends on the details of the specific program and it's
environment.
I'm trying to find a "fixed point" of a number that is for ex:

954 (high to lo) - 495 (lo to high) = 495
then next step
954 (high to lo) - 495 (lo to high) = 495

from here, I can say that 495 is a fixed point, I would like to put
this in a "storage" (array??) so I can print all the fixed points that
I've found later..(Cause I need to check for other fixed points of
other numbers)

NOTE: 495 is stored in an array of size 3, I had to store each digits
in an array to perform my sorting..

thanks for the help..

Dec 11 '06 #6
rhitz1...@gmail .com wrote:
Can't say unless you tell us what you're trying to do. In programming
there're, usually, many ways to accomplish something. What is most
suitable depends on the details of the specific program and it's
environment.

I'm trying to find a "fixed point" of a number that is for ex:

954 (high to lo) - 495 (lo to high) = 495
then next step
954 (high to lo) - 495 (lo to high) = 495

from here, I can say that 495 is a fixed point, I would like to put
this in a "storage" (array??) so I can print all the fixed points that
I've found later..(Cause I need to check for other fixed points of
other numbers)

NOTE: 495 is stored in an array of size 3, I had to store each digits
in an array to perform my sorting..
See my reply to you in the other thread.

Dec 11 '06 #7
On 10 Dec 2006 19:07:28 -0800, rh*******@gmail .com wrote:
>Hi all:

Is it possible to store an integer array to another integer array?
Or should I use an array of pointers that will point to a particular
array?
You can always copy array elements using a loop with an assignment
statement as long as each from_element processed by the loop has be
assigned or initialized with a value.

If you are referring to one dimensional arrays, then memcpy will copy
data from one array to another as long as the number of bytes you
specify is not larger than the size of either array. This may or may
not be "better" than using a loop with an assignment statement.

If the arrays are multi-dimensional with identical dimensions, memcpy
will still work.

If the arrays are multi-dimensional with different dimensions, memcpy
can still be used but there may be some "boundary" issues.
Remove del for email
Dec 12 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2372
by: Sanjay | last post by:
hi, We are currently porting our project from VB6 to VB .NET. Earlier we used to make scale transformations on objects like pictureBox , forms etc.Now Such transformations are made on the graphics object of the form/pictureBox. Should It be better if make a graphics object from my pictureBox in load event handler of the form and store it as member variable of the form , make
11
39453
by: deko | last post by:
I need to create a basic one-dimensional array of strings, but I don't know how many strings I'm going to have until the code is finished looping. pseudo code: Dim astrMyArray() Do While Not rst.EOF i = i + 1 If rst!Something = Then astrMyArray(i) = rst!Something
4
1830
by: RubenDV | last post by:
I am trying to make a cipher with a 256-bit key but i have no idea how the store this key without using arrays of ints or something like that. I just need a type that is big enough to hold the entire key, because i am going to use multiplication operations and such, which i can impossibly use on arrays or so i think. Is there a way to treat an array as a single, huge number without really being that? Any help is appreciated!
2
1438
by: martin | last post by:
Hi, I would appreciate knowing the best way to store a two dimensional array, and the bind that array to a dropdownlist. The original array is in the form integer, string and the list will look like this
10
5225
by: Peter Stojkovic | last post by:
I want store an integer-array of 1000 Values in a blob in a SQL-database. I will do this every 10 Seconds. How can I do this ???? What datatypes a have to use ??? Thanks
0
1220
by: sreemati | last post by:
Hi Everyone, I had an ASP page which takes all the column values in array and then passes it to store procedure. Now one of the variable in the store procedure needs to be changed from int to real but the array doesn't seems to be able to return a real back to variable in the store procedure, it rounds it off as integer. Can any one clarify why ASP array doesn't seem to be taking an real? Thanks in advance, Sree
4
2765
karthickbabu
by: karthickbabu | last post by:
Is Possible to store a value to declared Variable from Text Box at run time. I want to store a value from Text Box in 2 dimension array. First Value can be sotred in variable(0,0). If i press enter text box will be cleared and get another number and it stored in variable(0,1) and so on I try like this, but not working any problem in this code For i As Integer = 0 To 1 For j As Integer = 0 To 1 ...
0
1238
by: JuAn2226 | last post by:
hi this my code Private Sub Form_Load() car_count = 0 Cumulative_Speed = 0 End Sub Private Sub Timer1_Timer() Dim tmpNumber As Integer
0
1716
by: harshad | last post by:
Dear All,Here I am facing problem to store image.I am trying to store byte array(image) in to session variable so at time of update I will got that byte array and I do my update. here i am given following code so kindly help out me. on Button Click Event--------------------------------- Private Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click Try ' Dim fileUpload1 As FileUpload =...
0
8444
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, 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...
0
8356
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,...
0
8781
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 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...
1
8551
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,...
0
8639
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 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...
0
5664
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();...
0
4368
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
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...

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.