Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~394 People Reached
Favorite Forums
Favorite Tags
Member Avatar for applepomme

I need to pass part of a string to function: [CODE] string original_string="my_name_original"; string wanted_string (original_string,7); //take "my_name" only my_func(wanted_string, other_var); //func: void my_func(string wanted_string, int other_var); [/CODE] This doesn't seem to work, the compiling was OK but the passed "wanted_string" is empty; When pass char*, it works fine: [CODE] …

Member Avatar for Narue
0
129
Member Avatar for applepomme

for (i=0, i<imax, i++) { // ... Array< complex<float>, 3 > matrix(x,y,z); // x,y,z are large and vary in each loop // ... // matrix <=== values for each element assigned // ... // now want to write "matrix" in a single binary file. // later, this matrix can be …

Member Avatar for chiwawa10
0
185
Member Avatar for applepomme

I used this to write the matrix into a file: int Nx, Ny, Nz; Array <complex<float>, 3> matrix(Nx, Ny, Nz, ColumnMajorArray<3>()); ...get matrix data... fstream outbin(outname.c_str(),ios::out|ios::binary); outbin.write(reinterpret_cast<char *>(matrix.data()),sizeof(complex<float>)*Nx*Ny*Nz); outbin.close(); Then, I used this to read this matrix, works fine, values and orders are correct too: Array <complex<float>, 3> matrixb(Nx, Ny, …

0
80