![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
学习随记
ZhouYiks
这个作者很懒,什么都没留下…
展开
-
关于<cstring>头文件里的函数
在处理C风格的字符串是用到strcpy(array1,array2);strcat(array1,array2);这样的函数但是在现在的VS中会报错,应该用strcpy_s(array1,array2);strcat_s(array1,array2);原创 2019-02-22 10:40:05 · 688 阅读 · 0 评论 -
委托实现的三种方法
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace DelegateTest{ public delegate void SayDelegate(string name); cla...原创 2019-03-09 21:36:30 · 956 阅读 · 0 评论 -
一个使用数组区间的实例
#include <iostream>const int MAX = 5;double * fill_array(double *, double *);void show_array(double *, double *);void revalue(double, double *, double *);using namespace std;int main() {...原创 2019-03-03 16:13:53 · 594 阅读 · 0 评论 -
while循环填充数组的从后向前和从前向后方法
从后向前while (n-- >0) p[n] = c;注意是n–,所以是先比较在 减减从前向后int i=0;while (i < n) p[i++] = c;注意是先用原来的值再加加,所以第一个是p[0],而不是p[1]...原创 2019-03-02 12:53:15 · 937 阅读 · 0 评论 -
使用循环将值读入数组时如何提前结束循环
一种方法是使用一个特殊值来指出输入结束int fill_array(double ar[], int limit){ using namespace std; double temp; int i; for (i = 0; i < limit; i++) { cout << "Enter value #" << i + 1 << ":";...原创 2019-03-02 10:53:48 · 1469 阅读 · 0 评论 -
关于文件尾条件
先比较两个代码块#include<iostream>using namespace std;int main() { char ch; int count = 0; cin.get(ch); while (cin.fail() == false) { cout << ch; ++count; cin.get(ch);//通过<CTRL>...原创 2019-02-26 09:56:34 · 325 阅读 · 0 评论 -
如何让调试窗口不要闪退
cin.get(); cin.get(); 或 system(pause);原创 2019-02-20 09:49:41 · 1788 阅读 · 0 评论 -
怎样创建字符串数组
使用char *数组或string数组string month [Number]={{"January"},{"February"},{"March},{"April"}, {"May"},{"Jun"},{"July"},{"August"}, {"原创 2019-02-25 12:24:26 · 5129 阅读 · 0 评论 -
编写延时循环
#include <iostream>#include <ctime>int main() { using namespace std; cout << "Enter the delay time, in seconds: "; float secs; cin >> secs; clock_t delay = secs * CLOCKS...原创 2019-02-24 16:11:15 · 360 阅读 · 0 评论 -
使用new和delete来储存通过键盘输入的字符串
实例#include <iostream>#include <cstring>using namespace std;char * getname(void);int main() { char * name; name = getname(); cout << name << " at" << (int *)name &..原创 2019-02-23 20:45:39 · 302 阅读 · 0 评论 -
关于strcpy_s的参数
strcpy_s的第二个参数的大小应大于源字符串或数组的长度,如char temp[80]; cout << "Enter last name: "; cin >> temp; char * pn = new char[strlen(temp) + 1]; strcpy_s(pn,strlen(temp)+1,temp);//注意是strlen(temp)+1...原创 2019-02-23 17:44:25 · 4731 阅读 · 0 评论 -
在读取数字的循环时如何处理错误的输入(即非数字的输入)
#include <iostream>const int Max = 5;int main() { using namespace std; int golf[Max]; cout << "Please enter your golf scores.\n"; int i = 0; for (i = 0; i < Max; i++) { cout &l...原创 2019-02-27 14:59:49 · 444 阅读 · 0 评论 -
连续像对相对定向
Data=>Helper=>MainProcessDatapackage RelativeOrientation;public class Data { public double[][] dataL;//左像片点的像平面坐标 public double[][] dataR;//右像片点的像平面坐标}Helperpackage RelativeOrientatio...原创 2019-10-08 23:23:39 · 3735 阅读 · 0 评论