max2451
max2451
CC#
Created by max2451 on 1/9/2023 in #help
pointers help
how do i do that?
19 replies
CC#
Created by max2451 on 1/9/2023 in #help
pointers help
what are refs?
19 replies
CC#
Created by max2451 on 1/9/2023 in #help
pointers help
it says Unsafe code may only appear if compiling with /unsafe
19 replies
CC#
Created by max2451 on 1/9/2023 in #help
pointers help
this is mi code:
using System;

namespace Main {
class Program {
static void Main(string[] args) {
int a = 12;
int b = 21;

Console.WriteLine("a: {0} || b: {1}", a, b);

Console.WriteLine("a: {0} || b: {1}", a, b);
}

unsafe void Swap(int* a, int* b) {
int temp;
temp = *b;
*b = *a;
*a = *b;
}
}
}
using System;

namespace Main {
class Program {
static void Main(string[] args) {
int a = 12;
int b = 21;

Console.WriteLine("a: {0} || b: {1}", a, b);

Console.WriteLine("a: {0} || b: {1}", a, b);
}

unsafe void Swap(int* a, int* b) {
int temp;
temp = *b;
*b = *a;
*a = *b;
}
}
}
19 replies