What does ref mean?

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?
ref class means it's a .Net class.
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
that ref keyword is not really part of C++ isn't it?
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#.
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
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
Topic archived. No new replies allowed.