pointers are support in C#? if yes then how to use it?
Answers were Sorted based on User's Feedback
Answer / supratim sengupta
pointers in C# are considered as unsafe code. We can use
pointers in the same way as we use in C++ or VC++ but we
need to build it with a /unsafe option
Is This Answer Correct ? | 9 Yes | 1 No |
Answer / rajavel
ya... pointer can be used in c# for value and array
types...and in inside class too (but class-> reference type
so not applicable)in the class members which are not ref
type../ using fixed keyword ... but it is unsafe....
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / varsha vilas kalebag
yes, pointer is nothing but value is saved in another
memory address
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / preeti
Yes pointers are supported in c#.
Def:- pointers point to other veriable's memory address.
Uses:-
i)It uses in call by reference concept.
ii)Number of pointers can point to same memory address.
iii)using pointer there is working on exact memory location
instead of other veriable.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kiran
yes we can use pointers same as in c++ and c but pointer concept is not supported in c# but we can implement using interface concept
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / baru
yes,pointers can support in c#.Basically variables can hold and work on values of data types but pointers can work on addresses of those variables so memory space utilization will be efficient as these pointers works on available memory spaces
Is This Answer Correct ? | 0 Yes | 0 No |
#include <iostream> using namespace std; int main() { int a = 2; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][c[1][4]]; }
What is virtual function?where and when is it used?
what is the 3 types of system development life cycle
What is class and example?
what is the difference between class to class type conversion and copy constructor ?
what is the difference between inter class and abstract class...?
What is the outcome of the line of code "cout<<abs(- 16.5);"? 1) 16 2) 17 3) 16.5
Why do while loop is used?
what are the realtime excercises in C++?
what is the difference between a package and a software?
What are the benefits of polymorphism?
what is function overloading..?