• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

C++ Example?

Could someone please send me an example code of a c++ program that has a Window with a button and a textfield. When the button is clicked it displays the word "Hello" In the textfield.
I want this because i  want to see how c++ works and what it's like.
I learn well from looking at code!
And I know alot of you will say you can't learn from an example but I know java and I just want a look.
Could you please keep the code simple and comment it? Thanks!!
0
dvd99
Asked:
dvd99
1 Solution
 
jhanceCommented:
Why don't you get the book "Programming Windows" by Charles Petzold?  It's the best introductory text to the Windows API and will introduce you to all the basic concepts.  It's packed with examples and is a valuable resources even to veteran Windows programmers.
0
 
WxWCommented:
If you have no knowledge of C++ , reading a Windows Program is really confusing . Try studying DOS programs first .
0
 
TriskelionCommented:
What compiler and OS are you using?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
dvd99Author Commented:
i am using Win98 but I don't plan to complie it just have a look, it shouldn't be too confusing!
0
 
sureshkumarCommented:
if you want to develop windows you have to use vc++.if you are ready to use vc++ then i will give solution to your problem.

ok....

for further queries welcome.
0
 
KangaRooCommented:
Wait, I have to agree with WxW. If you are learning C++ stay away from Windows for a while. It is confusing.
You won't learn C++ from using VC or BCB, stay away from them until you understand\footnote{Upto a certain degree} C++
0
 
dvd99Author Commented:
ok then can someone please give me a dos "Hello world example?" and how to complie it and run the exe?
0
 
viktornetCommented:
#include <iostream.h>

int main(void)
{
  cout << "Hello World!";
  return 0;
}



Press CTRL-F9 to compile on most compilers...

>>if you want to develop windows you have to use vc++
btw, this is not true AT ALL!! You can use other compilers to develop Win32 apps....

..-=ViKtOr=-..
0
 
WxWCommented:
And , the best way of learning C++ is to use a NON visual compiler . Otherwise you are limited to the features the visual editor provides .

or

#include <stdio.h>
int main()
{
  printf("Hello World!\r\n");
  return 0;
}
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now