当前位置:网站首页>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
边栏推荐
猜你喜欢
弘玑微课堂 | Cyclone RPA之“灵活的数字员工”执行器
[triangle Yang Hui triangle printing odd even cycle JS for break cycle]
What role do tools play in digital transformation?
phphphphphphphp
Graphics. Fromimage reports an error "graphics object cannot be created from an image that has an indexed pixel..."
Qingdao agile tour, coming!
Laravel [view]
selenium預先加載cookie的必要性
Basic use of sqlyog
Laravel routing settings
随机推荐
Laravel routing settings
Uniapp wechat sharing
Error handling mechanism of the strongest egg framework in history
Modèle axé sur le domaine DDD (III) - gestion des transactions à l'aide de Saga
Traversal array, object parent-child communication props / $emit
Call the interface to get the time
[untitled] Notepad content writing area
The 2021 IT industry project management survey report was released!
Why can't V-IF and V-for be used together
Log introduction and building web application
世界与个人发展
JSON.
Data bus realizes the communication between brother components
可执行程序执行流程
Master-slave replication of MariaDB database
创建进程内存管理copy_mm - 进程与线程(九)
Solution of how to log in with mobile phone verification code in wireless network
JS time format conversion
[no title] Click the classification jump page to display the details
Data management of basic operation of mairadb database