![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
文章平均质量分 82
匆匆美梦奈何天
游戏开发
展开
-
C++中IO流的循环读取,txt文件的行数
C++中IO流的循环读取ifstream myfile("C:\\Users\\94038\\Desktop\\test_02\\string.txt", ios::in); string ss; while (getline(myfile, ss)) { cout << setw(15) << "分析栈" << setw(15) << ...原创 2019-04-16 21:47:28 · 965 阅读 · 0 评论 -
C++成员函数return this或者*this
C++成员函数return this或者*this首先说明:this是指向自身对象的指针,*this是自身对象。第一:return *this返回的是当前对象的克隆(副本)或者本身(若返回类型为A, 则是克隆(实际上是匿名对象), 若返回类型为A&, 则是本身 )。当你要重复使用.方法(a.add(b).add(b))的时候,可以返回本身(A&)。Test& Te...原创 2019-04-16 21:34:14 · 1719 阅读 · 0 评论 -
c++无法将参数 2 从“const char [9]”转换为“char *”
c++无法将参数 2 从const char [9]转换为char *#include "pch.h"#include <iostream>#include<cstring>using namespace std;class Student {public: Student() { this->id = 0; this->name = NU...原创 2019-04-18 14:58:42 · 6415 阅读 · 1 评论 -
类对象在堆区或者栈区的区别
类对象在堆区或者栈区的区别#include <iostream>using namespace std;class Test {public: int a; Test() { a = 1; }};int main() { Test *t1 = new Test(); t1->a = 10; Test *t2 = new Test(); t2-...原创 2019-04-16 21:38:31 · 890 阅读 · 1 评论 -
链表的使用以及链表逆序,链表倒置反转
#include "stdafx.h"#include <string>#include <iostream>#include <Windows.h>using namespace std;class LinkNode{public: int nID; string name; LinkNode* pNext;};class Link...原创 2019-08-13 14:59:06 · 120 阅读 · 0 评论 -
简单的算法题:实现strcpy
// 算法题1.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <Windows.h>#include <iostream>using namespace std;char* MyStrcpy(char* dst,const char* src){ if (dst == nullptr || src =...原创 2019-08-19 20:12:44 · 134 阅读 · 0 评论