C++ 如何循环向数组中添加数

考虑到两种办法:第一种: 用动态数组的办法,类似于int * i = new ...之类的,没有具体研究。

                                第二种:用vector。vector的详细介绍参考大神博客https://blog.csdn.net/fanyun_01/article/details/56842637

                                                先创建一个空的vector< int > i,然后使用方法a.push_back,通过循环的办法向vector中添加值。

猜你喜欢

转载自blog.csdn.net/qq_27942333/article/details/84783325
今日推荐