第十章编程练习(7)
来源:互联网 发布:lifemod软件下载 编辑:程序博客网 时间:2024/06/05 00:45
ff.h
#pragma once#ifndef ff_H_#define ff_H_class Plorg {private:char name[19];int cl;public:Plorg(char p_name[19] = "Plorga", int n = 50);void setcl(int n);void showpl()const;};#endif
function.cpp
#include "ff.h"#include <iostream>using namespace std;Plorg::Plorg(char p_name[19], int n){strcpy(name, p_name);cl = n;}void Plorg::setcl(int n){cl = n;}void Plorg::showpl()const{cout << "Name :" << name<<endl<< "CL :" << cl<<endl;}
main.cpp
#include <iostream>#include "ff.h"#include <cstdlib>using namespace std;int main(){Plorg pl;pl.showpl();cout << "Please enter your name: ";char name[19];cin.getline(name, 19);Plorg sl(name);sl.showpl();cout << "Please enter your CL: ";int n = 0;cin >> n;sl.setcl(n);sl.showpl();system("pause");return 0;}
0 0
- 第十章编程练习(7)
- 第十章 编程练习
- 第十章 编程练习4-7
- 第十章编程练习(1)
- 第十章编程练习(2)
- 第十章编程练习(3)
- 第十章编程练习(4)
- 第十章编程练习(5)
- 第十章编程练习(6)
- python核心编程--第十章 11.11 练习
- (一二一)第十章编程练习
- Python核心编程 第十章练习
- python核心编程第十章练习
- C++ primer plus 第十章编程练习
- 编程练习(第十一周)
- 编程练习(第十四周)
- 《C Primer Plus 第五版》第十章编程练习
- 《c primer plus》编程练习回顾-第十章
- 编写高质量代码:Web前端开发修炼之道(四)
- [Spring实战系列](11)SpEL使用表达式装配
- 例题6-7 UVa122 Trees on the level(树&&队列BFS&&sscanf字符串转整数)
- Codeforces 77C 树形DP
- Priest John's Busiest Day
- 第十章编程练习(7)
- Codeblosks用C++编写通用DLL供其他语言调用
- memset用法详解(转)
- Codeforces 55D 数位DP
- PAT_乙级1036
- js字符串方法(总结)
- 【URAL 刷题记】URAL 1028 ~ URAL 1035
- C#成神之路<13> C#对类的设计
- flush()