What does ref mean?

Jan 10, 2011 at 11:59am
If I create class using visual studio I get the option of selecting whether I want some managed code.

1
2
3
4
5
6
7
ref class platformDependent
{
public:
	platformDependent(void);
	static void downloadLotsOfLocation ();
	static LocationList loc;
};



What does ref means?
Jan 10, 2011 at 2:19pm
ref class means it's a .Net class.
Jan 11, 2011 at 4:55pm
Let me guess

Microsoft C++ is not exactly the same with regular C++ isn't it?

Microsoft add his stuff to make sure that programs written in one doesn't work on other platform.

That being said, I must admit it's a good improvement except for one simple issue. If I only want to run my program only on Windows I wouldn't use C++. I would have used a much easier to use vb.net
Jan 11, 2011 at 4:55pm
that ref keyword is not really part of C++ isn't it?
Jan 11, 2011 at 5:01pm
No it's not. Microsoft's managed version of C++, called C++/CLI uses a sort of Virtual Machine. It's really a completely different language than C++. And yes, if you write in C++/CLI it will only run on Windows.

teguh123 wrote:
If I only want to run my program only on Windows I wouldn't use C++. I would have used a much easier to use vb.net


That's correct. Typically if a company is developing .Net apps they don't lean toward C++/CLI, usually they go with C#.
Jan 11, 2011 at 6:57pm
Well at least it's easy to port my program to some other platform. Not that easy if you use C# and definitely impossible if you use vb.net
Jan 12, 2011 at 1:55am
Anyone heard of MonoDevelop? I tried running a C# and C++/CLI windows form compiled with Visual Studio and runs without a problem at all in ubuntu. I didn't dig deep though, I'm just curious if it really works.

[edit]
Forgot the link: http://monodevelop.com/
Last edited on Jan 12, 2011 at 1:55am
Topic archived. No new replies allowed.