Solved

stupid beginner's question

Posted on 1998-06-04
4
224 Views
Last Modified: 2010-04-01
I am just taking my first steps with C++ (Borland C++ Builder 3).
Until now I have only programmed with Visual Basic, so it's quite hard to understand the syntax of C++.

Can anyone give me a small sample listing, like letting the user enter two numbers and making a mathematical operation with them by button-click and writing the new number to an Edit box?

Does anyone know a good link to a C++ beginners page with simple samples?

Thank you.

E.C.
0
Comment
Question by:EricClapton
  • 3
4 Comments
 

Author Comment

by:EricClapton
Comment Utility
Edited text of question
0
 

Author Comment

by:EricClapton
Comment Utility
Edited text of question
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
Comment Utility
I highly would NOT recommend learning C++ on the Windows platform. Essentially, you would be learning too many different things all at once. It would be better to learn C++ using the command line compiler.

For example, you would create this program using standard C++:

  #include <iostream.h>
 
  int main()
  {
    int op1;
    int op2;

    cout << "Enter two numbers: ";
    cin << op1;
    cin << op2;

    // do something with operands
    int ans = op1 * op2;
    cout << "The product is " << ans << endl;
    return 0;
  }


0
 

Author Comment

by:EricClapton
Comment Utility
Mhmm.. this didn't quite answer my question but anyway - you'll get the points.
Think I ought to get a book for C++ (I learned Visual Basic by just using the online-help but C++ really seems to a bit harder)

E.C.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now