
学习随记
ZhouYiks
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
关于<cstring>头文件里的函数
在处理C风格的字符串是用到 strcpy(array1,array2); strcat(array1,array2); 这样的函数但是在现在的VS中会报错,应该用 strcpy_s(array1,array2); strcat_s(array1,array2);原创 2019-02-22 10:40:05 · 778 阅读 · 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 · 1030 阅读 · 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 · 669 阅读 · 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 · 1025 阅读 · 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 · 1548 阅读 · 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 · 399 阅读 · 0 评论 -
如何让调试窗口不要闪退
cin.get(); cin.get(); 或 system(pause);原创 2019-02-20 09:49:41 · 1867 阅读 · 0 评论 -
怎样创建字符串数组
使用char *数组或string数组 string month [Number]={{"January"},{"February"},{"March},{"April"}, {"May"},{"Jun"},{"July"},{"August"}, {"原创 2019-02-25 12:24:26 · 5233 阅读 · 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 · 456 阅读 · 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 · 356 阅读 · 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 · 4825 阅读 · 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 · 522 阅读 · 0 评论 -
连续像对相对定向
Data=>Helper=>MainProcess Data package RelativeOrientation; public class Data { public double[][] dataL;//左像片点的像平面坐标 public double[][] dataR;//右像片点的像平面坐标 } Helper package RelativeOrientatio...原创 2019-10-08 23:23:39 · 4028 阅读 · 0 评论