当前位置:网站首页>C method parameter: in
C method parameter: in
2022-06-13 03:07:00 【cathy18c】
Method parameter in Can only read , Cannot modify within a method , It and ref It also needs to be initialized as an argument , And the same as ref equally , Whether you define a method or call a method, you need to add in keyword .
class Program
{
static void Add(in int num1)
{
num1++; // This place reported a mistake , Tips in num1 It's a read-only variable
Console.WriteLine("Add In the way num1 The value of is :{0}", num1);
}
static void Main(string[] args)
{
int num1=0;
Add(in num1);
Console.WriteLine("Main In the way num1 The value of is :{0}",num1);
}
}
in It's worth passing on , Is the default delivery , Even if you don't write in The default is in
Parameters :in Parameter modifiers
边栏推荐
- Ijkplayer source code -- Library loading and initialization
- . New features in net 6.0 _ What's new in net 6.0
- Qt之QTreeView的简单使用(含源码+注释)
- Uni app Foundation
- Review notes of RS data communication foundation STP
- Pycharm installation pyqt5 and its tools (QT designer, pyuic, pyrcc) detailed tutorial
- 技术博客,经验分享宝典
- Applet image component long press to identify supported codes
- How to become a technological bull -- from the bull man
- Vant框架中关于IndexBar索引栏的CDN单页面引用,无法正常展示
猜你喜欢
2019 - sorting out the latest and most comprehensive IOS test questions (including framework and algorithm questions)
Prometheus install and register services
JVM class loading (I)
Detailed explanation of handwritten numeral recognition based on support vector machine (Matlab GUI code, providing handwriting pad)
Pycharm installation pyqt5 and its tools (QT designer, pyuic, pyrcc) detailed tutorial
Prometheus node_ Exporter installs and registers as a service
Binary tree initialization code
專業的數據庫管理軟件:Valentina Studio Pro for Mac
【pytorch 记录】pytorch的变量parameter、buffer。self.register_buffer()、self.register_parameter()
Keil removes annoying st link update tips
随机推荐
wx. Createselectorquery() gets the usage of DOM nodes in components
Ijkplayer source code - choose soft decoding or hard decoding
IOS development interview knowledge sorting - OC Foundation (II)
Hash table: least recently used cache
Prometheus node_ Exporter installs and registers as a service
mysql索引
Six special GPU products for domestic aircraft passed the appraisal and review
JVM GC (V)
How to select fund products? What kind of fund is a good fund?
C # simple understanding - static members and static classes
Simple use of leaflet - offline map scheme
JVM class loading (I)
Install MySQL database
Ijkplayer source code - setting options
JS deconstruction assignment
Scala implements workcount
Hash table: valid anagrams
HEAP[xxx.exe]: Invalid address specified to RtlValidateHeap( 0xxxxxx, 0x000xx)
JVM heap (IV)
数字IC设计——FIFO的设计