- 博客(13)
- 收藏
- 关注
原创 连续像对相对定向
Data=>Helper=>MainProcessDatapackage RelativeOrientation;public class Data { public double[][] dataL;//左像片点的像平面坐标 public double[][] dataR;//右像片点的像平面坐标}Helperpackage RelativeOrientatio...
2019-10-08 23:23:39
3993
原创 委托实现的三种方法
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
1017
原创 一个使用数组区间的实例
#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
653
原创 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
1009
原创 使用循环将值读入数组时如何提前结束循环
一种方法是使用一个特殊值来指出输入结束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
1530
原创 在读取数字的循环时如何处理错误的输入(即非数字的输入)
#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
509
原创 关于文件尾条件
先比较两个代码块#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
381
原创 怎样创建字符串数组
使用char *数组或string数组string month [Number]={{"January"},{"February"},{"March},{"April"}, {"May"},{"Jun"},{"July"},{"August"}, {"
2019-02-25 12:24:26
5207
原创 编写延时循环
#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
441
原创 使用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
345
原创 关于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
4797
原创 关于<cstring>头文件里的函数
在处理C风格的字符串是用到strcpy(array1,array2);strcat(array1,array2);这样的函数但是在现在的VS中会报错,应该用strcpy_s(array1,array2);strcat_s(array1,array2);
2019-02-22 10:40:05
757
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人