Is C-style string unchangable?221 (12/30/2005 2:43:18 PM) comp.lang.c++ Dear All, I hear a lot that cstring cannot be changed. But my code: /************************************************************* * Testing cstring(a pointer) * ******************************************... Xiaoshen
pointer and string626 (12/30/2005 12:26:28 PM) comp.lang.c++ Dear All, My textbookd of C++ teaches string before teaching pointer. After teaching pointer, it doesn't come back to string. I hope to learn how to use a pointer to char to manipulate string? For example, I... Xiaoshen
why pass-by-reference of a pointer variable?714 (12/30/2005 12:18:06 PM) comp.lang.c++ Dear All, I thought I understood using pointer variables as function parameters. But I failed to understand why it is needed pass-by-reference of a pointer variable. To me, pointer variable is address varia... Xiaoshen
a deconstructor question1122 (12/30/2005 11:57:56 AM) comp.lang.c++ Dear All, I am a little confused. //Objects of this class are partially filled arrays of doubles class PFArray { public: ... ~PFArray(); private: double *a; //for an array of doubles .. }; PFArray::~PF... Xiaoshen
how to change a parent directory?1138 (12/22/2005 1:21:26 PM) comp.os.linux.misc Dear All, I have several directoies as follows: ~/A/foo_1/foo_2/foo_3/ ~/B/foo_1/foo_2/foo_3/ ~/C/foo_1/foo_2/foo_3/ I am currently working in ~/A/foo_1/foo_2/foo_3/. I hope to change to ~/B/foo_1/foo_/foo_... Xiaoshen
why no copy constructor in java?1015 (12/22/2005 11:49:47 AM) comp.lang.java.programmer Dear All, Sorry for coming back to the old topic. I really cannot understand what some people has said before. Here I am not interested in clone(), sorry. In C++, without copy constructor, MyClass Obj_1 = n... Xiaoshen
confused with function declarations1028 (12/21/2005 6:46:17 PM) comp.lang.c Dear All, I am confused with prototypes in C. I saw the following code in a C book: void init_array_1(int data[]) { /* some code here */ } void init_array_2(int *data_ptr) { /* some code here*/ } int ma... Xiaoshen
what is the difference between string.h and cstring?327 (12/16/2005 4:02:53 PM) comp.lang.c++ Dear All, I saw some people using #include some people using #include What is the difference between the two? I can find the file string.h at /usr/include. I don't know if cstring is a file and if so, whe... Xiaoshen
what is the difference between string.h and cstring?632 (12/16/2005 3:59:17 PM) comp.lang.c Dear All, I saw some people using #include some people using #include What is the difference between the two? I can find the file string.h at /usr/include. I don't know if cstring is a file and if so, whe... Xiaoshen
How to define a class GasPump?518 (12/12/2005 7:32:16 PM) comp.lang.c++ Dear All, I am reading a textbook "Absolute C++" by Walter Savitch. After a chapter talking about classes, a programming project puzzled me: Write the difinition for a class named GasPump to be used to model... xli6(111)
question--A function returns class object(comparing C++ & JAVA)1125 (12/13/2005 5:00:28 PM) comp.lang.c++ Dear Sir, I am a little puzzled about a function returning a class object, for example, suppose I hava a class Money and a method: Money lastYear(Money aMoney) { Money tempMoney; ... return tempMoney; } ... xli6(111)
question--separatecompilation1831 (12/14/2005 3:25:39 PM) comp.lang.c++ Dear All, I have a question regarding to linking separate files for compilation. For example, I have two file in the same directory: file1.cpp & file2.cpp. ==> file1.cpp file2.cpp using namespace std; ext... xli6(111)
package related questions512 (12/16/2005 12:13:51 PM) comp.lang.java.programmer Dear All, I am learning package name and have been puzzled a lot. I have asked similar questions before, based on the replies, I have made some progress. *****************WHAT I CAN MAKE IT WORK:************... xli6(111)
A simple question about a function353 (12/16/2005 1:44:58 PM) comp.lang.c Dear All, I am puzzled by how to use strtod(). I have pasted its man page below. I don't understand what char **endptr is and why it is needed there. Thank you very much. STRTOD(3) ... xli6(111)
confused with function declarations1028 (12/21/2005 6:46:17 PM) comp.lang.c Dear All, I am confused with prototypes in C. I saw the following code in a C book: void init_array_1(int data[]) { /* some code here */ } void init_array_2(int *data_ptr) { /* some code here*/ } int ma... xli6(111)
Copy Constructor and Initialization by Temporaries819 (12/28/2005 3:10:02 AM) comp.lang.c++ I am initializing a class variable using a temporary, example: abc a1, a2; abc a3 = a1+a2; (See prog below) I expect a copy constructor to be invoked for initialization of a3. So in all, I expect 4 constructor... anujanujdhamija(16)
why pass-by-reference of a pointer variable?714 (12/30/2005 12:18:06 PM) comp.lang.c++ Dear All, I thought I understood using pointer variables as function parameters. But I failed to understand why it is needed pass-by-reference of a pointer variable. To me, pointer variable is address varia... xli6(111)
a deconstructor question1122 (12/30/2005 11:57:56 AM) comp.lang.c++ Dear All, I am a little confused. //Objects of this class are partially filled arrays of doubles class PFArray { public: ... ~PFArray(); private: double *a; //for an array of doubles .. }; PFArray::~PF... xli6(111)