473,786 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

An allocated double array question

2 New Member
I'll be most thankful if someone could help me with the following:

1. A double array is declared and allocated in an object's constructor

class Snapshot
{
private:
double **Coord; // The atoms coordinates
.
.
.

2. this array should be accessed via

double Snapshot::GetCo or()
{
return Coord;
}


3. The array should than be passed from within its object to a function

for(int i = 0; i < SnapshotList.si ze(); i++)
{
double Rmsd = GetRMSD(SnapCoo r, SnapshotList[i].GetCoor());
}
}

where GetRMSD's header is

double GetRMSD(double A[][DIMENSION], double B[][DIMENSION])


Of course this does not work. I'll be most thankull for any suggestion made.

Thanks allot

Arik
Sep 25 '09 #1
2 1824
donbock
2,426 Recognized Expert Top Contributor
Take a look at Arrays Revealed. It should help.
Sep 25 '09 #2
acohen
2 New Member
Thanks allot for the ultrafast response and help.

Arik
Sep 25 '09 #3

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

Similar topics

4
2729
by: C++fan | last post by:
Hi all: I have a question about memory allocation to an object of a class. For example, I define the following class: class example_class{ public: example_class(); void funtion_1();
7
2438
by: masood.iqbal | last post by:
I am having lots of trouble getting a simple program that initializs a dynamically allocated 2D array to work. My 2D array is not getting initialized properly, and additionally I am getting a "Null pointer assignment" error. Kindly help. Also, eventually I intend to move this logic to a separate function. For that, I believe, that I will need to pass a pointer-to-pointer-to-pointer type as an arguent. Please confirm.
2
3550
by: Jonathan Underwood | last post by:
Hi I have a 2 dimensional array allocated as a contiguous chunk of memory, as described in Question 6.16 in the FAQ (i.e. in the manner of array 2 on the page http://www.eskimo.com/~scs/C-faq/q6.16.html). I have a function declared as func(..., array,...) and I wish to pass my 2D array to that function. As I understand it, this should be allowable since the 2D array is contiguous in memory, and if i therefore call it as func(...,...
31
3742
by: bilbothebagginsbab5 AT freenet DOT de | last post by:
Hello, hello. So. I've read what I could find on google(groups) for this, also the faq of comp.lang.c. But still I do not understand why there is not standard method to "(...) query the malloc package to find out how big an allocated block is". ( Question 7.27) Is there somwhere explained why - because it would seem to me, that free()
5
5600
by: nmtoan | last post by:
Hi, I could not find any answer to this simple question of mine. Suppose I have to write a program, the main parts of it are as follows: #include <blahblah.h> struct {
3
1541
by: johnmann56 | last post by:
Hello. I have a small C# program which uses a number of large arrays of double. The program runs fine on my desktop PC which has 2 GB of memory, but when run on my laptop with 512 MB the laptop practically freezes up, from running out of memory. I would therefore like to modify my program so that memory space used by the various arrays can be freed up once I am done with each array. I have tried many things before calling GC.Collect(),...
11
2641
by: mast2as | last post by:
This question has been posted to this forum before and I read the thread but found that the answers were perhaps imcomplete, so I am trying again. Whenever I am creating objects I would like to keep track of the memory which is used for each object (for stats purpose). They are 2 basic approaches, one is to write a Memory manager type of class where new & delete would be overloading the standard new & delete operator. Each time the new...
1
10021
by: mattmao | last post by:
Hello everyone, this is my first thread in this .NET forum. Since I am studying C#.NET in this semester, I reckon this would be just the right place for my asking questions regarding the C# language and the .NET framework:) I got some experience of ANSI C where you declare an array in stack, so: int myArray; would allocate a continous piece of memory in stack which can contain 10 integers in total.
7
1784
by: runn | last post by:
Can a class has a member array which will be dynamically allocated during runtime? Such as double* A=new double here n is an integer member variable and will be determined during runtime and the class will have the array *A allocated. Thanks in advance.
0
9650
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
9497
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
10363
Oralloy
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...
1
10110
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
9962
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
6748
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
5398
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...
1
4067
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
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.