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.

~3K People Reached
About Me

I C enthusiasm PLUS fortitude PLUS inspiration.

Favorite Forums
Favorite Tags
c++ x 18

12 Posted Topics

Member Avatar for nanchuangyeyu

Hi, I have implemented my first C++ class as following thanks to the generous help of Ancient Dragon: [CODE] typedef unsigned long ULONG; class CMatrix { public: CMatrix(const CMatrix& m); CMatrix(size_t row, size_t col); ULONG sum(); size_t s_row(); size_t s_col(); CMatrix& operator *= (const CMatrix& m); private: size_t _s_row; size_t …

Member Avatar for Tom Gunn
0
107
Member Avatar for nanchuangyeyu

Hi, I am a C++ newbie and had never written even a very simple C++ class before. Now I intend to do such a job. My objective is quite simple, a matrix class with the following features is just OK: [COLOR="Red"]1. The object of such a class can be initialized …

Member Avatar for Ancient Dragon
0
388
Member Avatar for nanchuangyeyu

Hi, My coding objective is quite simple: design a function to write the data in a matrix into files. And here is my code: [CODE] #include <iostream> #include <fstream> #include <string> using namespace std; int matwrite(float* mp,int row_sz,int col_sz,string mat_file); int main() { // create a simple binary file first …

Member Avatar for Ancient Dragon
0
188
Member Avatar for nanchuangyeyu

Hi, I want to design a two dimensional matrix C++ class of myself. In prospect this class should implement such functions: 1. It should be able to be initialized by a binary data file(a .raw file without any header or format infomation.) with the file name as an argument of …

Member Avatar for siddhant3s
0
109
Member Avatar for nanchuangyeyu

Hi, I know the return value of generic search algorithm "find()" is of iterator type. Now how can I output the return value as numeric type? For example: [CODE] short myArray[4] = {2,1,3,7}; vector<short>mVec(myArray,myArray+4); vector<short>::iterator found; found = find(mVec.begin(),mVec.end(),2); [/CODE] In this code the variable found will be assigned the …

Member Avatar for StuXYZ
0
267
Member Avatar for nanchuangyeyu

Hi, I am now using VS2005 to write a console program. Since the [CODE]int main(int argc, char** argv) [/CODE] function is designed to accept parameters, how can I pass them to the program while debugging in step by step mode?thank u in advance.

Member Avatar for tux4life
0
89
Member Avatar for nanchuangyeyu

Hi, I am trying to declare a 3D array with the size of 6,400 and 400 in each dimension using the code as following: [CODE] short matrix[6][400][400]; [/CODE] but actually it introduced a run time error "stack overflow" after surviving the compilation.So what's wrong with this code and how to …

Member Avatar for ArkM
0
212
Member Avatar for nanchuangyeyu

Hi, What I actually want to do is really quite simple,that is, convert all the data(of short type)in a file to their abstract values respectively.But I did not accomplish it. Here my code is listed:[CODE] #include <iostream> #include <cmath> #include <fstream> using namespace std; int main() { char *in_name = …

Member Avatar for ArkM
0
133
Member Avatar for nanchuangyeyu

Hi, I am writing some code to model the neighborhood of an element in an 2D mathematic matrix(using 2D vector) ,e.g. to an element indexed by vec_2d[x][y], I want to present its neighborhood in form of a vector which is composed of vec_2d[x][y-1],vec_2d[x-1][y-1],vec_2d[x-1][y] and vec_2d[x-1][y+1]. And following my code is …

Member Avatar for Nick Evan
0
829
Member Avatar for nanchuangyeyu

Hi, I have written a 2*3 matrix[1,2,3;4,5,6] to file. And then I tried to read the data back to initialize a 2D C++ vector. The code is as following: [CODE] #include <cmath> #include <string> #include <iostream> #include <sstream> #include <fstream> #include <vector> using namespace std; int main() { ofstream out_file; …

Member Avatar for nanchuangyeyu
0
121
Member Avatar for nanchuangyeyu

Hi, I tried to present a 2D mathematic matrix with C++ vector and expand it by repeating the first and last row and column. An example for intuition, I initialized a 2D C++ vector vec_2d to be as following: 1, 2, 3, 4 5, 6, 7, 8 9,10,11,12 13,14,15,16, and …

Member Avatar for Narue
0
195
Member Avatar for nanchuangyeyu

Hi, I am now writing a simple program for testing file I/O and an advanced vector class. Unfortunately I have encountered some confusing problems. My code is as following: [CODE] #include <cmath> #include <string> #include <iostream> #include <sstream> #include <fstream> using namespace std; class mVect { private: // NO PRIVATE …

Member Avatar for nanchuangyeyu
0
130

The End.