Value in C ++ Participate in quoted small problems

xiaoxiao2021-03-06  60

I have generated a habitual thinking when I have learned PASCAL: When the function is called, if you don't want the value of the parameters before and after the function call, use the value ginseng; if you want to change, . In C / C , there is no shape, all of which are transmitted, and reference is similar to the methano in Pascal. (I don't know if this is appropriate). So, when using C , I have this way of thinking: When the function is called, if you don't want the value of the parameters before and after the function call, use the value ginseng; if you want to change, use a denser reference. A casual mistake today, I haven't been right. The problem is simplified, the following is a definition and implementation of a class: Class Ca {public: CA (Char * a_pcchar = "test"); Virtual ~ CA ();

Private: char * m_pcchar;}; CA :: CA (Char * a_pcchar) {f (a_pcchar == null) {m_pcchar = null; return;} m_pcchar = new char [256]; MEMSET (m_pcchar, '/ 0', Sizeof (char) * 256); struffpy (m_pcchar, a_pcchar);

转载请注明原文地址:https://www.9cbs.com/read-112027.html

New Post(0)