
c++
一千克欣喜
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
while (cin && cin.get() != '\n') continue;
在c++的学习中,经常遇到下面这段代码:while (cin && cin.get() != '\n') continue;作用这段代码常常跟在输入之后,作用是过滤掉换行符。例如下面这段代码:String sayings[ArSize]; char temp[MaxLen]; int i; for (i = 0; i < ArSize; i++) { ...原创 2019-11-16 16:00:27 · 4017 阅读 · 3 评论 -
C++ PRIMER PLUS(第5版)第十一章 编程练习
#pragma once//vector.h#ifndef VECTOR_H_#define VECTOR_H_#include<iostream>namespace VECTOR { class Vector { public: enum Mode{RECT,POL}; private: double x; double y; double m...原创 2019-11-10 16:45:03 · 163 阅读 · 0 评论 -
C++ PRIMER PLUS(第5版) 第九章 编程练习
//golf.hconst int Len = 40;struct golf{ char fullname[Len]; int handicap;};void setgolf(golf &g, const char *name, int hc);int setgolf(golf &g);void handicap(golf &g, int hc)...原创 2019-08-18 17:57:17 · 250 阅读 · 0 评论 -
C++ PRIMER PLUS(第5版) 第八章 编程练习
#include "stdafx.h"#include<iostream>using namespace std;int countt = 0;void show(char* cp, int n = 0);int main(){ char *chs="I do not think so."; show(chs); show(chs, 3); show(chs...原创 2019-08-12 15:25:52 · 371 阅读 · 2 评论 -
对象和类应用实例(C++)
…以下为C++中类和对象的应用实例,实例关于股票(stock)。包含3个文件:stock1.h;stock1.cpp;practice.cppstock1.h文件提供类的声明;stock1.cpp实现类中函数的定义;practice.cpp应用类。1、stock1.h#pragma once#include<string>class Stock{public: S...原创 2019-08-27 16:52:50 · 1080 阅读 · 1 评论 -
C++ PRIMER PLUS(第5版)第十章 编程练习(上)
//bank.h#pragma onceconst int SIZE = 20;class Bank{private: char name[SIZE]; char account[SIZE]; int money;public: Bank(); Bank(char* bname, char* baccount, int bmoney=0); void showBan...原创 2019-09-22 21:04:27 · 160 阅读 · 0 评论 -
C++ PRIMER PLUS(第5版)第十章 编程练习(下)
//plorg.hconst int SIZE = 20;class Plorg {private: char name[SIZE]; int CI;public: Plorg(char* na="Plorga",int ci=50); void resetCI(int ci); void show();};//plorg.cpp#include "stdafx...原创 2019-10-07 16:15:09 · 137 阅读 · 0 评论