ok heres my problem...
In c++ you can do something like this...
void something(char *crap){
memcpy(crap, "new value", 9);
}
void main(){
char MyValue[100];
something(MyValue);
cout<<MyValue;
}
'MyValue' would be printed as 'new value'
how do you do this in c#.
[MyndFyre edit: changed the subject]
That's somewhat odd code for C#; you wouldn't copy string data. You wouldn't want to anyway; .NET maintains a string table.
But, you can pass value-types by reference:
void something(ref int num) {
num *= num; // squares it.
}
void Main(string[] args) {
num = 5;
something(ref num);
Console.WriteLine(num); // outputs 25.
}
thanks