2 Replies - 2732 Views - Last Post: 06 February 2006 - 06:04 AM Rate Topic: -----

#1 Sergio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-February 06

Variable Declarations & Output

Posted 05 February 2006 - 01:12 PM

Hello

In VB when declare a variable we do this
Dim cFirst As Currency
cFirst = Val(txtFirst.Text)
how I can do this in Visual C++?

and

In VB when i want to display a second form I write this:
e.g form2.show
In Vicual C++ how I can do this?


Thx For Your Time
Sergio
Is This A Good Question/Topic? 0
  • +

Replies To: Variable Declarations & Output

#2 Amadeus  Icon User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 248
  • View blog
  • Posts: 13,506
  • Joined: 12-July 02

Re: Variable Declarations & Output

Posted 05 February 2006 - 01:47 PM

Using C++, you declare a variable using it's type and the name...to declare a variable of the integer type, you would use:
int myVar;


To output that variable, it really depends on where you are outputting the variable to...if a console,it can be output using the output stream:
cout<<myVar;


however, the process would be different if you wanted the output to display to a message box, or text box, or label...did you have a particular situation in mind?
Was This Post Helpful? 0
  • +
  • -

#3 Sergio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-February 06

Re: Variable Declarations & Output

Posted 06 February 2006 - 06:04 AM

In C++ I know this my question is for Visual C++ (windows form application)

This post has been edited by Sergio: 06 February 2006 - 06:09 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1