![]() |
|
Creating a Basic Mathmatic Program in C++ - Printable Version +- Southperry.net (https://www.southperry.net) +-- Forum: Social (https://www.southperry.net/forumdisplay.php?fid=14) +--- Forum: Rubik's Cube (https://www.southperry.net/forumdisplay.php?fid=58) +--- Thread: Creating a Basic Mathmatic Program in C++ (/showthread.php?tid=429) |
Creating a Basic Mathmatic Program in C++ - Hazzy - 2008-07-03 Well, I want to write a program to do a pretty simple function, using Visual C++ Microsoft 2008 Edition. However, first, I wanted to get the hang of what needs to be done to get any program to work, so I took one out of my book, Code: bool accept () I typed it up in a new *.cpp file, and tried to debug. The debug option was grayed out, so I'm thinking I need to do more than just type up a file. So, my question, how exactly do I get a simple program to work? D: I have no idea how C++ works, lol, as this is my first real attempt at trying to make a program. Please and thank you for your time. ![]() *Is half away at 9:30 in the morning and has made weird typos like spelling "done" as "dun* ~~~~~~~~~~~~~ I tried compiling with the Command Prompt, that's what I got from the Help tab, and got these errors. Code: C:\Program Files\Microsoft Visual Studio 9.0\vc\bin>cl /EHsc BoolAccPro.cppHow do I declare the identifiers? ._. Creating a Basic Mathmatic Program in C++ - Spaz - 2008-07-03 Looks like you're missing Code: #include <iostream>You'll also need a main function. Creating a Basic Mathmatic Program in C++ - x0xpriestx0x - 2008-07-09 maybe you should try to learn the most easiest program first. Here is the most simplest program that typed out "Hello World!" #include <iostream.h> main() { for(; ![]() { cout << "Hello World! "; } } or if i remember correctly it'll also work if you just have #include <iostream.h> main() { cout << "Hello World! "; } Here is the link to that program. http://www2.latech.edu/~acm/helloworld/c++.html You would also need to go read the beginners book or maybe try C++ for dummies first. You can't just learn how to program without reading a book. Creating a Basic Mathmatic Program in C++ - Conciente - 2008-07-09 All programs have the following: Quote:#include <stdio.h> To declare the identifiers you do the following: Quote:data_type variable_name; If you want to make a simple math equation, like adding two numbers, here's an example: Quote:#include <stdio.h> |