当前位置:网站首页>Write the declaration of a function to return the reference of the array, and the array contains 10 string objects (notes)
Write the declaration of a function to return the reference of the array, and the array contains 10 string objects (notes)
2022-04-23 05:27:00 【What’smean】
1.string( &func( ))[10];
The meaning of the above statement is : func () Represents a call to func Function does not need any arguments ,(&func( ) ) Indicates that the return result of the function is a reference ,( &func( ))[10] Indicates that the referenced object is a dimension of 10 Array of ,string (&func( )) [10] The element representing the array is string object .
2. Use type aliases
typedef string arr [10];
arr& func( );
3. Use tail return type
auto func( ) ->string(&)[10];
4. Use decltype keyword
string str [10];
decltype (str) &func( );
版权声明
本文为[What’smean]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220544124128.html
边栏推荐
- selenium預先加載cookie的必要性
- Fast application fuzzy search
- npm升级后问题,慌得一批
- Use pagoda + Xdebug + vscode to debug code remotely
- 使用宝塔+xdebug+vscode远程调试代码
- Multi process model in egg -- egg document Porter
- C# ,类库
- 狼叔来找翻译人员了--plato--持续翻译中.....
- [triangle Yang Hui triangle printing odd even cycle JS for break cycle]
- The annual transaction volume of the app store is US $1 million, and only 15% commission is paid. Small and medium-sized developers are very contradictory
猜你喜欢

Excel 2016 打开文件第一次打不开,有时空白,有时很慢要打开第二次才行

Quick app bottom navigation bar

Create process memory management copy_ Mm - processes and threads (IX)

相机成像+单应性变换+相机标定+立体校正

Project manager's thinking mode worth trying: project success equation

Getting started with varnish

Uniapp wechat sharing

How to set the initial value of El input number to null

MFC实现资源单独Dll实现

varnish入门
随机推荐
史上最强egg框架的error处理机制
Excel 2016 打开文件第一次打不开,有时空白,有时很慢要打开第二次才行
Basic knowledge of redis
2021-09-27
Camera imaging + homography transformation + camera calibration + stereo correction
Why can't V-IF and V-for be used together
phphphphphphphp
Membarrier (personal learning and understanding)
Laravel routing settings
Laravel implements the Holy Grail model with template inheritance
Three of three JS (webgl) is simple to draw lines / arcs according to points (based on linegeometry / line2 / linematerial, draw two arc segments based on the center of the circle)
Kanban Quick Start Guide
How to set the initial value of El input number to null
Implementation of resnet-34 CNN with kears
Nécessité de précharger les cookies dans le sélénium
CPT 104_TTL 09
Three of three JS (webgl) simple sorting of rotation attribute function, and a simple case of rotating around the axis based on this
egg测试的知识大全--mock、superTest、coffee
Uniapp wechat sharing
可执行程序执行流程