Dear All,

My name is Davin Eastley and I'm 13 years old. I wrote my first C++ 2005
Application yesterday with no resources by playing around with C++ Express
Edition for half the day. I assigned x as an int (with the value of 20) and
got the compiler to tell me whether it was greater than 2 or not. This was
the code I used:

private: System::Void button1_Click(System::Object^ sender,
System::EventArgs^ e)
{


int x;

x = 1;

//this assigns x as an int

//(a variable - data type -)


if (x >= 2)

{

// if x is greater than 2, output a messagebox saying x is greater than 2.

MessageBox::Show(L"x is greater than 2!");

}

if (x < 2)

{

// if x is lower than 2, output a messagebox saying x is lower than 2.

MessageBox::Show(L"x is lower than 2!");

}


}

This is straight from the compiler. This is the new style of C++ 2005. I am
very happy to write my first application in C++. I also wrote a console
application which uses Console::WriteLine instead of the messagebox
equivalent. I still want to know how to use the cout and cin keywords
though. Time to do some more learning on C++!



Regards,

Davin Eastley

--------------

www.davineastley.tk

Forums Home

Re: My first C++ Application in VC++ 2005 Express! by Davin

Davin
Mon Jun 06 02:44:36 CDT 2005

I based this on my knowledge in C# so the C++ Express team have done a good
job simplifying it! I commend the team working on it and wish them the best
of luck. I am currently training for MCAD certification in C# and I wish
that the C++ exams would come back to the Language Choices for MCAD
Certification.

Regards,
Davin Eastley

---------
www.davineastley.tk
Forums Home


"Davin Eastley" <davineastley@netspace.net.au> wrote in message
news:utqANqmaFHA.3384@TK2MSFTNGP09.phx.gbl...
> Dear All,
>
> My name is Davin Eastley and I'm 13 years old. I wrote my first C++ 2005
> Application yesterday with no resources by playing around with C++ Express
> Edition for half the day. I assigned x as an int (with the value of 20)
> and got the compiler to tell me whether it was greater than 2 or not. This
> was the code I used:
>
> private: System::Void button1_Click(System::Object^ sender,
> System::EventArgs^ e)
> {
>
>
> int x;
>
> x = 1;
>
> //this assigns x as an int
>
> //(a variable - data type -)
>
>
> if (x >= 2)
>
> {
>
> // if x is greater than 2, output a messagebox saying x is greater than 2.
>
> MessageBox::Show(L"x is greater than 2!");
>
> }
>
> if (x < 2)
>
> {
>
> // if x is lower than 2, output a messagebox saying x is lower than 2.
>
> MessageBox::Show(L"x is lower than 2!");
>
> }
>
>
> }
>
> This is straight from the compiler. This is the new style of C++ 2005. I
> am very happy to write my first application in C++. I also wrote a console
> application which uses Console::WriteLine instead of the messagebox
> equivalent. I still want to know how to use the cout and cin keywords
> though. Time to do some more learning on C++!
>
>
>
> Regards,
>
> Davin Eastley
>
> --------------
>
> www.davineastley.tk
>
> Forums Home
>
>



Re: My first C++ Application in VC++ 2005 Express! by George

George
Tue Jun 07 09:28:57 CDT 2005

Davin Eastley wrote:
> Dear All,
>
> My name is Davin Eastley and I'm 13 years old. I wrote my first C++ 2005
> Application yesterday with no resources by playing around with C++ Express
> Edition for half the day. I assigned x as an int (with the value of 20) and
> got the compiler to tell me whether it was greater than 2 or not. This was
> the code I used:
>
> private: System::Void button1_Click(System::Object^ sender,
> System::EventArgs^ e)
> {
>
>
> int x;
>
> x = 1;
>
> //this assigns x as an int
>
> //(a variable - data type -)
>
>
> if (x >= 2)
>
> {
>
> // if x is greater than 2, output a messagebox saying x is greater than 2.
>
> MessageBox::Show(L"x is greater than 2!");
>
> }
>
> if (x < 2)
>
> {
>
> // if x is lower than 2, output a messagebox saying x is lower than 2.
>
> MessageBox::Show(L"x is lower than 2!");
>
> }
>
>
> }
>
> This is straight from the compiler. This is the new style of C++ 2005. I am
> very happy to write my first application in C++. I also wrote a console
> application which uses Console::WriteLine instead of the messagebox
> equivalent. I still want to know how to use the cout and cin keywords
> though. Time to do some more learning on C++!
>
>
>
> Regards,
>
> Davin Eastley
>
> --------------
>
> www.davineastley.tk
>
> Forums Home
>
>
Davin,

Ummm, not to burst you bubble or anything, but what you posted does not
look like C++ code. Consider you function header:

> private: System::Void button1_Click(System::Object^ sender,
> System::EventArgs^ e)

The caret (^) is the bit-wise exclusive or operator in C++, and can not
be used as type decorator so I am not quite sure what 'System::Object^'
is.

I strongly suggest getting a good reference on C++ (see the list at
http://www.accu.org/bookreviews/public/reviews/0hr/beginner_s_c__.htm)
for a list of _very_ good beginning C++ resources.

While the VC++ 2005 might be a good compiler, I beleive that it brings
along the dotNet framework as well as managed C++. These may all be
good things, but I feel you should learn C++ proir to jumping into
all the non-standard extentions that Microsoft has built in. To this
end I would suggest, at least for the start, using something like
mingwStudio (http://www.parinyasoft.com/). Once you have a strong
footing in standard C++ you then can move into dotNet, managed C++
and the like.

George

Re: My first C++ Application in VC++ 2005 Express! by Mark

Mark
Tue Jun 07 09:36:40 CDT 2005


>>
> Davin,
>
> Ummm, not to burst you bubble or anything, but what you posted does not
> look like C++ code. Consider you function header:
>

Actually, that "^" is the new symbol for a garbage collection managed
pointer. Managed C++ (which is what hes using) gets confused between
real pointers and GC pointers. So a new operator was designed.

CString* pMyString; // Normal C++ pointer
String^ pMyString2; // New Managed C++ pointer

Hope that helps

Re: My first C++ Application in VC++ 2005 Express! by George

George
Tue Jun 07 12:06:43 CDT 2005

Mark Ingram wrote:
>
>>>
>> Davin,
>>
>> Ummm, not to burst you bubble or anything, but what you posted does
>> not look like C++ code. Consider you function header:
>>
>
> Actually, that "^" is the new symbol for a garbage collection managed
> pointer. Managed C++ (which is what hes using) gets confused between
> real pointers and GC pointers. So a new operator was designed.
>
> CString* pMyString; // Normal C++ pointer
> String^ pMyString2; // New Managed C++ pointer
>
> Hope that helps

I sort-of though that the caret (^) was a non-standard microsoft
extention to the language (as is managed C++ a non-standard
extention).

My advice to his still is to learn _standard_ C++ before attempting
to learn Microsoft's extentions to the language. A strong knowledge
of standard C++ will carry Davin far, and he will not be limiting
himself to Microsoft only platforms.

George

Re: My first C++ Application in VC++ 2005 Express! by Carl

Carl
Tue Jun 07 13:06:57 CDT 2005

"George Huber" <huber_geo@hotmail.com> wrote in message >
> I sort-of thought that the caret (^) was a non-standard microsoft
> extention to the language (as is managed C++ a non-standard
> extention).
>
> My advice to his still is to learn _standard_ C++ before attempting
> to learn Microsoft's extentions to the language. A strong knowledge
> of standard C++ will carry Davin far, and he will not be limiting
> himself to Microsoft only platforms.

Not to argue (I agree completely, in fact), but the new "C++/CLI" extensions
are also being standardized (through ECMA) and should eventually show up in
other C++ compilers that target the CLI (.NET, Mono, etc).

-cd



Re: My first C++ Application in VC++ 2005 Express! by andré

andré
Tue Jun 07 13:49:24 CDT 2005

>
> My name is Davin Eastley and I'm 13 years old. I wrote my first C++ 2005
> Application yesterday with no resources by playing around with C++ Express
> Edition for half the day. I assigned x as an int (with the value of 20)
> and got the compiler to tell me whether it was greater than 2 or not. This
> was the code I used:

> Davin Eastley

Good for you ! I wrote a peace at 13 as well but back then
it was on a Commodore 64 using Basic =] .

I'd like to invite you to consider geting a book on c++
and write small Console applications to start. If you take the road
that goes through VisualC++ you need to learn a lot more then c++.
For exemple you'd have to learn about using the Enviroment, the APIs,
libraries that are build-in.. All of wich require you a clear understanding
of C++ to begin with... It can be done but its realy like trying to hammer
a nail with a pencil.

But you have all the time you need to decide what you want to do realy ;)




Re: My first C++ Application in VC++ 2005 Express! by George

George
Tue Jun 07 13:56:48 CDT 2005

Carl Daniel [VC++ MVP] wrote:
> "George Huber" <huber_geo@hotmail.com> wrote in message >
>
>>I sort-of thought that the caret (^) was a non-standard microsoft
>>extention to the language (as is managed C++ a non-standard
>>extention).
>>
>>My advice to his still is to learn _standard_ C++ before attempting
>>to learn Microsoft's extentions to the language. A strong knowledge
>>of standard C++ will carry Davin far, and he will not be limiting
>>himself to Microsoft only platforms.
>
>
> Not to argue (I agree completely, in fact), but the new "C++/CLI" extensions
> are also being standardized (through ECMA) and should eventually show up in
> other C++ compilers that target the CLI (.NET, Mono, etc).
>
> -cd
>
>
So when will the C++/CLI extensions show up in ISO/ansi C++?

Never I suspect.

Maybe I am jaded or overly conservative, but I view standard C++ as what
is defined by the ISO/ansi committee.

I know that there is no pure C++ compiler available today, in that every
compiler adds something to the language -- although in most cases these
are new types or additional functions in the standard libraries. For
example the type 'long long' is not a valid ansi type, but it is
accepted by the gnu compiler. However, I know of no compiler that adds
additional operands and still claims to be the same language. Maybe, if
Microsoft wants to continue down this path they should claim that the
language is a _new_ langauge and drop all references to C++?

George

Re: My first C++ Application in VC++ 2005 Express! by William

William
Tue Jun 07 14:34:35 CDT 2005

"George Huber" <huber_geo@hotmail.com> wrote in message
news:O2ufyK5aFHA.3932@TK2MSFTNGP12.phx.gbl...
> Maybe, if Microsoft wants to continue down this
> path they should claim that the language is a _new_ langauge and drop all
> references to C++?

That would be a good plan if it was not possible to mix metaphors - if it
was not possible to craft an application that contained instances of classes
allocated on .Net's garbage collected heap as well as instances of native
classes allocated dynamically in the standard way or on the stack using ISO
standard C++ idioms. Right now, C++/CLI's forte is that is equally strong on
both sides of the boundary between the "managed" and native environments.

Standard C++ and C++/CLI are different languages with a shared heritage that
goes back to K&R.

Regards,
Will



Re: My first C++ Application in VC++ 2005 Express! by Carl

Carl
Tue Jun 07 15:23:07 CDT 2005


"George Huber" <huber_geo@hotmail.com> wrote in message
news:O2ufyK5aFHA.3932@TK2MSFTNGP12.phx.gbl...
> Carl Daniel [VC++ MVP] wrote:
>> "George Huber" <huber_geo@hotmail.com> wrote in message >
>>
>>>I sort-of thought that the caret (^) was a non-standard microsoft
>>>extention to the language (as is managed C++ a non-standard
>>>extention).
>>>
>>>My advice to his still is to learn _standard_ C++ before attempting
>>>to learn Microsoft's extentions to the language. A strong knowledge
>>>of standard C++ will carry Davin far, and he will not be limiting
>>>himself to Microsoft only platforms.
>>
>>
>> Not to argue (I agree completely, in fact), but the new "C++/CLI"
>> extensions are also being standardized (through ECMA) and should
>> eventually show up in other C++ compilers that target the CLI (.NET,
>> Mono, etc).
>>
>> -cd
>>
>>
> So when will the C++/CLI extensions show up in ISO/ansi C++?
>
> Never I suspect.

Actually, the ECMA standard will become an ISO standard shortly after
approval by ECMA. When will CLI bindings show up in a descendant of ISO
14882? Probably never - as it should be. C++ and C++/CLI are different
(but related) languages.

Will ideas from C++/CLI find their way into "native" C++? Likely. The ECMA
committee has many members of the ISO C++ committee, and the two groups
coordinate their efforts on areas where they overlap.

-cd



Re: My first C++ Application in VC++ 2005 Express! by Davin

Davin
Tue Jun 07 23:58:11 CDT 2005

Thanks everybody. The information should help. Andre - thanks for your
message also. I have written applications in QBASIC before. And I have
written applications in C#, Visual Basic .NET and now one in VC++ Express.

Regards,
Davin Eastley

----------
www.davineastley.tk
Forums Home


"Davin Eastley" <davineastley@netspace.net.au> wrote in message
news:utqANqmaFHA.3384@TK2MSFTNGP09.phx.gbl...
> Dear All,
>
> My name is Davin Eastley and I'm 13 years old. I wrote my first C++ 2005
> Application yesterday with no resources by playing around with C++ Express
> Edition for half the day. I assigned x as an int (with the value of 20)
> and got the compiler to tell me whether it was greater than 2 or not. This
> was the code I used:
>
> private: System::Void button1_Click(System::Object^ sender,
> System::EventArgs^ e)
> {
>
>
> int x;
>
> x = 1;
>
> //this assigns x as an int
>
> //(a variable - data type -)
>
>
> if (x >= 2)
>
> {
>
> // if x is greater than 2, output a messagebox saying x is greater than 2.
>
> MessageBox::Show(L"x is greater than 2!");
>
> }
>
> if (x < 2)
>
> {
>
> // if x is lower than 2, output a messagebox saying x is lower than 2.
>
> MessageBox::Show(L"x is lower than 2!");
>
> }
>
>
> }
>
> This is straight from the compiler. This is the new style of C++ 2005. I
> am very happy to write my first application in C++. I also wrote a console
> application which uses Console::WriteLine instead of the messagebox
> equivalent. I still want to know how to use the cout and cin keywords
> though. Time to do some more learning on C++!
>
>
>
> Regards,
>
> Davin Eastley
>
> --------------
>
> www.davineastley.tk
>
> Forums Home
>
>



Re: My first C++ Application in VC++ 2005 Express! by Hendrik

Hendrik
Wed Jun 08 04:44:23 CDT 2005

William DePalo [MVP VC++] <willd.no.spam@mvps.org> wrote:
> "George Huber" <huber_geo@hotmail.com> wrote in message
> news:O2ufyK5aFHA.3932@TK2MSFTNGP12.phx.gbl...
> > Maybe, if Microsoft wants to continue down this
> > path they should claim that the language is a _new_ langauge and drop all
> > references to C++?
>
> That would be a good plan if it was not possible to mix metaphors [...]

The same goes for C/C++.
Still, they have different (even though similar)
names.

> Will


Schobi

--
SpamTrap@gmx.de is never read
I'm Schobi at suespammers dot org

"Coming back to where you started is not the same as never leaving"
Terry Pratchett