473,402 Members | 2,064 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,402 software developers and data experts.

Exporting a 2D array.....

I have a rather elusive problem and have spent some amount of time on
it, I would very kindly appreciate it if anyone could give me insight
on how to solve this problem. I tried to include what I thought was
necessary without overkilling it. Basically it seems as if a "lattice"
is being created. the tgrundgitter(~,~,~,~) is declared in another
header file. as well as heightfct(~,~). I don't understand what is
going on in the lattice->gethightfct(heightfct); and furthermore what
I really really want to do is get the 2Dimensional array "t2darray"
with all the elements in it and then transport them into the
d2_RootMeanSquare(int n, ?) function. I put ? in the function because
I don't know how to do this, I don't understand the syntax... Could
someone please help me out on how to do this and explain it to me???

Thanks,

Brian

lattice = new
tgrundgitter(latticeparameter.atomex,latticeparame ter.atomey,latticeparameter.atomez,latticeparamete r.gridtype);

t2darray<short>
heightfct(latticeparameter.atomex,latticeparameter .atomey);
lattice->gethightfct(heightfct);

TwoDimRMS.d2_RootMeanSquare(16,heightfct);
//---------- "In Header File".

public:
int d2_RootMeanSquare(int n, int vector[][16]);
int d2_RMS::d2_RootMeanSquare(int n, int vector[][16]){
for (a=0;a<n;a++){
x = 0;
for (b=0;b<n;b++){
x = x + pow(vector[a][b],2);
}}

Jul 17 '06 #1
8 1549
* Relative0:
I have a rather elusive problem and have spent some amount of time on
it, I would very kindly appreciate it if anyone could give me insight
on how to solve this problem. I tried to include what I thought was
necessary without overkilling it. Basically it seems as if a "lattice"
is being created. the tgrundgitter(~,~,~,~) is declared in another
header file. as well as heightfct(~,~). I don't understand what is
going on in the lattice->gethightfct(heightfct); and furthermore what
I really really want to do is get the 2Dimensional array "t2darray"
with all the elements in it and then transport them into the
d2_RootMeanSquare(int n, ?) function. I put ? in the function because
I don't know how to do this, I don't understand the syntax... Could
someone please help me out on how to do this and explain it to me???

Thanks,

Brian

lattice = new
tgrundgitter(latticeparameter.atomex,latticeparame ter.atomey,latticeparameter.atomez,latticeparamete r.gridtype);

t2darray<short>
heightfct(latticeparameter.atomex,latticeparameter .atomey);
lattice->gethightfct(heightfct);

TwoDimRMS.d2_RootMeanSquare(16,heightfct);
//---------- "In Header File".

public:
int d2_RootMeanSquare(int n, int vector[][16]);
int d2_RMS::d2_RootMeanSquare(int n, int vector[][16]){
for (a=0;a<n;a++){
x = 0;
for (b=0;b<n;b++){
x = x + pow(vector[a][b],2);
}}
The answer your problem is in the FAQ; see <url:
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8>.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 17 '06 #2
Relative0 wrote :
int d2_RMS::d2_RootMeanSquare(int n, int vector[][16]){
for (a=0;a<n;a++){
x = 0;
for (b=0;b<n;b++){
x = x + pow(vector[a][b],2);
}}
To use operator[] with a multi-dimension array, all numbers of elements
for each dimension but the last must be known.
Therefore, to be able to do that you would need to declare vector
differently, for an example int[16][].
Jul 17 '06 #3
Alf,

I am not sure what the link you sent me was for, but it seems
there are no answers, (atleast to the problem I am trying to figure
out).

Brian
Alf P. Steinbach wrote:
* Relative0:
I have a rather elusive problem and have spent some amount of time on
it, I would very kindly appreciate it if anyone could give me insight
on how to solve this problem. I tried to include what I thought was
necessary without overkilling it. Basically it seems as if a "lattice"
is being created. the tgrundgitter(~,~,~,~) is declared in another
header file. as well as heightfct(~,~). I don't understand what is
going on in the lattice->gethightfct(heightfct); and furthermore what
I really really want to do is get the 2Dimensional array "t2darray"
with all the elements in it and then transport them into the
d2_RootMeanSquare(int n, ?) function. I put ? in the function because
I don't know how to do this, I don't understand the syntax... Could
someone please help me out on how to do this and explain it to me???

Thanks,

Brian

lattice = new
tgrundgitter(latticeparameter.atomex,latticeparame ter.atomey,latticeparameter.atomez,latticeparamete r.gridtype);

t2darray<short>
heightfct(latticeparameter.atomex,latticeparameter .atomey);
lattice->gethightfct(heightfct);

TwoDimRMS.d2_RootMeanSquare(16,heightfct);
//---------- "In Header File".

public:
int d2_RootMeanSquare(int n, int vector[][16]);
int d2_RMS::d2_RootMeanSquare(int n, int vector[][16]){
for (a=0;a<n;a++){
x = 0;
for (b=0;b<n;b++){
x = x + pow(vector[a][b],2);
}}

The answer your problem is in the FAQ; see <url:
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.8>.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 18 '06 #4
loufoque,

I am not sure what you mean, so I am supposed to put int
vector[16][], what does this do and what do I do with it? I am a bit
new, (relatively speaking), so perhaps you might go a little more in
depth?

Thanks,

Brian
loufoque wrote:
Relative0 wrote :
int d2_RMS::d2_RootMeanSquare(int n, int vector[][16]){
for (a=0;a<n;a++){
x = 0;
for (b=0;b<n;b++){
x = x + pow(vector[a][b],2);
}}

To use operator[] with a multi-dimension array, all numbers of elements
for each dimension but the last must be known.
Therefore, to be able to do that you would need to declare vector
differently, for an example int[16][].
Jul 18 '06 #5
Relative0 wrote :
loufoque,

I am not sure what you mean, so I am supposed to put int
vector[16][], what does this do and what do I do with it? I am a bit
new, (relatively speaking), so perhaps you might go a little more in
depth?
If you have "int vector[][16]" then you can't do vector[a](b] because
the size of the first dimension is not known.

Jul 18 '06 #6
loufoque wrote:
Relative0 wrote :
>loufoque,

I am not sure what you mean, so I am supposed to put int
vector[16][], what does this do and what do I do with it? I am a bit
new, (relatively speaking), so perhaps you might go a little more in
depth?

If you have "int vector[][16]" then you can't do vector[a](b] because
the size of the first dimension is not known.
You most certainly can. Vector[][16] is array of unknown size
of arrays of 16 ints. That's all you need to know to do
vector[a][b]. The only thing you don't know is the sizeof
the entire object.
Jul 18 '06 #7
Ron Natalie wrote :
You most certainly can. Vector[][16] is array of unknown size
of arrays of 16 ints.
That's all you need to know to do
vector[a][b]. The only thing you don't know is the sizeof
the entire object.
Seems like I got the order wrong then.
Jul 18 '06 #8
Relative0 wrote:
loufoque,

I am not sure what you mean, so I am supposed to put int
vector[16][], what does this do and what do I do with it? I am a bit
new, (relatively speaking), so perhaps you might go a little more in
depth?
Please don't top-post. Your reply belongs following or interspersed
with properly trimmed quotes. See the newsgroup FAQ:
<http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.4>


Brian
Jul 18 '06 #9

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

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
1
by: Jacky11 | last post by:
I have a column name the Data type is MEMO The input is more than thousands of characters. When exporting, not all the information is exported. Who can I correct this problem? Thanks
2
by: Kenneth | last post by:
How do I remove the limitation in Access that deny me from exporting 24000 rows and 17 columns (in a query) into Excel? Kenneth
1
by: Suffrinmick | last post by:
Hello Everyone I've built a database using Access 2000 which includes a query which is built using a form containing filters. No problem. When I export the results of the query to excel, (File >...
6
by: Angel | last post by:
I'm exporting (with DllImport) a C-style function with this syntax: int z9indqry (4_PARM *parm); 4_PARM is a structure declared in a proprietary header file that cannot be included in my...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to...
4
by: HKKID | last post by:
I've got a program in C that creates a 2 dimensional array pN with dimensions of and . I need to export the array to excel, so I can do useful math on it. I can get the fwrite command to save a...
9
by: AM | last post by:
Hi, I have a C++ Dll that has a function that is being exported as shown below extern "C" __declspec(dllexport) validationResult __stdcall _validateData(double dataToMat, int time); A...
0
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm exporting a COM interface from my C# application. I want to to export a function that will have an array argument of structs. The struct is like: public struct MyStaruct { int A; int...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.