how to modify the value type data which is parameter passed into function?
-
2012년 4월 28일 토요일 오전 3:40
If I want to modify the value type data ,which is passed into function as paramter,in function,what can I do?
I am intent to box the data in order to consider it as a ref type,but it is readonly.
Now I have to pass it out as a return value;
모든 응답
-
2012년 4월 28일 토요일 오전 5:26중재자
Could you please describe your question in more detail?
You can modify the value type data just as what you did in traditional c++ application.
For example, You create a winrt lib and define follow function:
public bool func1(int* param1);
Then you can modify the value of param1 in func1. You can call func1 in your C# metro style application:
func1(out param1);
Best Regards,
Han Xia
- 편집됨 Han Xi -MSFTMicrosoft Employee, Moderator 2012년 4월 28일 토요일 오전 5:27
-
2012년 4월 28일 토요일 오전 6:13
Readonly Variable or Object doesn't have set property..
So ,you can't change it's value.
It never be as reference type...
You can't change value type of object at runtime
Please, If answer match your requirement then set mark as answer
-
2012년 4월 30일 월요일 오전 7:38중재자
Hello,
Please describe your question detail.
Do you want to use reference to in C++/CX? if so, you can use % instead of & in native C++. Please check this document.
http://msdn.microsoft.com/en-us/library/windows/apps/br212455.aspxBest regards,
JesseJesse Jiang [MSFT]
MSDN Community Support | Feedback to us
- 답변으로 표시됨 Jesse JiangMicrosoft Contingent Staff, Moderator 2012년 5월 7일 월요일 오전 2:16

