+45

Is there any possibility to use pointers with C # in the SoloLearn playground ?.

Could the unsafe option be activated in the SoloLearn IDE?

c#

3/22/2019 12:46:53 AM

Juan Baños

5 Answers

New Answer

+35

In C # the keyword unsafe is used to use the pointers. _ Must be compiled with the / unsafe option. To set this option in Visual Studio: - Open the Project Properties page. - Click on the Generate property page. - Check the Allow non-secure code check box. _ Methods, types and blocks of code can be defined as unsafe. -Types of pointers: type * identifier; void * identifier; // allowed but not recommended A pointer can be type sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal or bool, any type of enum, pointer or struct that only contains fields of unmanaged types. Declare several pointers in the same declaration: int * p1, p2, p3; // Okay int * p1, * p2, * p3; // Invalid in C # int * p (p is a pointer to an integer) int ** p (p is a pointer to a pointer or an integer) int * [] p (p is a one-dimensional array of integer pointers) char * p (p is a pointer to a char value) void * p (p is a pointer to an unknown type) https://code.sololearn.com/c5bwRPPC1dGt/?ref=app

+9

One CANNOT avoid using pointers. It used in passing parameters.

+6

김해성 i aggree that using pointer can have catastrophic result. All the more reason it should be tackled as a concept, at least

+2

Actually speaking I haven't use it but I think it possible

+1

Is there any possibility to use pointers with C # in the SoloLearn playground ?. Could the unsafe option be activated in the SoloLearn IDE?