Question:
How do i write C++ script?
anonymous
1970-01-01 00:00:00 UTC
How do i write C++ script?
22 answers:
jrvb_9
2009-01-11 16:17:27 UTC
Get a compiler and/or IDE. Two good choices are GCC, or if your computer is running Windows, Visual Studio Express Edition. A good, simple, easy to use compiler is the Bloodshed Dev-C++

Some Examples (Copy and Paste this into a text/code editor)





A simple program is given by Bjarne Stroustrup (developer of C++) to check your compiler.



#include

#include

using namespace std;

int main ()



{



string s;

cout << "Please enter your first name followed by a newline \n" ;

cin >> s;

cout << "Hello, " << s << '\n' ;

return 0; // this return statement isn't necessary

}





// The sum of two numbers.



#include

using namespace std;

int main ()





{

int no1, no2, sum ;

cout << "\nEnter the first number = " ;

cin >> no1 ;

cout << "\nEnter the second number = " ;

cin >> no2 ;

sum = no1 + no2 ;

cout << "\nThe sum of "<< no1 <<" and "<< no2 <<" = "<< sum '\n' ;

return 0 ;

}





Save this as sum.cpp, Don't confuse there are many other extensions for C++ files, choose any of them (like *.cc, *.cxx, *.c++, *.cp) .

HINT : It should say Save as Type: {select "All Files"}

Compile it.

For users of linux and gcc compiler

Command : g++ sum.cpp

Users of Window can use any C++ compiler

Like MS Visual C++ or any they like to use

Run the program

For users of Linux and gcc compiler

Command : ./a.out (a.out is a executable file produce by compiler after compilation of program.)
mrwynd
2009-01-11 16:12:05 UTC
You can learn how to understand basic programming and how C++ specifically works with an online tutorial.



http://www.cplusplus.com/doc/tutorial/
anonymous
2016-03-03 08:25:55 UTC
I don't think it's possible and if it is, you would need a special parser for the CGI to make it work. Most Common Gateway Interface scripts use: Perl, Python, Ruby or another obscure and rarely used language. It may be possible to use C++ but I don't think there are many people that would these days. Your best bet would be to search google. J
?
2016-02-12 08:29:25 UTC
write script
anonymous
2009-01-11 16:15:38 UTC
You will either need to take classes, or get a book on C++.



It would be impossible for anyone to teach you C++ on Yahoo Answers.
Din
2009-01-11 18:16:38 UTC
I'd recommend CodeBlocks as an IDE over Dev C++. It's free (GPLv3) and is still actively being developed. Dev C++ hasn't seen any activity since Feb 2005.
anonymous
2009-01-11 16:15:26 UTC
first i used this

http://www.cplusplus.com/doc/tutorial/

to get used to the syntax (im used to java right now)



then i used this

http://www.brpreiss.com/books/opus4/programs/index.html

to play with some source code



I already know classes, object orienting, and server and client stuff. But since this is a object oriented language, i HIGHLY recommend you thoroughly learn that (not the first thing you learn obviously).
beaner
2009-01-11 16:12:46 UTC
here are some links.



http://www.wikihow.com/Create-a-Simple-Program-in-C%2B%2B

http://www.wikihow.com/Create-Some-Simple-Programs-in-C%2B%2B
Lavigne Levine
2009-01-11 17:06:10 UTC
have turbo c installed and learn basic things like the use of a semicolon and other stuff..



i find it hard..



maybe you can do better.
Kitty
2009-01-11 16:11:25 UTC
usually you need to take classes for that, it's not as easy as html
mr_gees100_peas
2009-01-11 18:56:45 UTC
You are a brave person since C++ is one of the hardest language to learn. I started with plain old C which is equally hard. Ofcourse at the time I did not know this. The reason many people consider C/C++ hard is because they are hardware languages. When you write C/C++ code you are usually getting very close to the hardware level. The other two lower levels are assembly and toggling bits directly by jumping some wires. The advantage of C++ is that you will get the most control with the best performance. The disadvantage is that you have to deal with a lot of things yourself. For example you are responsible for not going out of range when using an array or you have to reclaim memory if you allocate it dynamically. Once you start studying it you will see what I mean. Other languages like Java, python, C# and others take care of the grunt work for you and yet provide equal of comparable power. Ok, not the same power but in reality, for most thing most people do speed is usually not an issue.



My advice to you is instead of choosing a language to learn, instead start with a project. For example, what woud you like to do. Do you want to create web pages? Do you want to make a video game for a console? Maybe you just want to create some text parsing program. Maybe all you want is to learn how to program a robot. Once you define your project then choose a platform. For example if you want to make neat web pages then you are looking at javascript and html. However, if you are looking into video games then you are looking at C++ or maybe even C# if you want to program the BOX 360. If you want to parse text like for example, you have a lot of data and you just want to print out only the things you need or organized that data in a human readable format then perl is your friend. Then a gain python can do it too.



The thing is that language is more often that not chosen by the problem or task. If you buy a device then the manufacturer will provide you with some sort of language they use. Usually not the one you want or would like to use. Jobs are the same one guys chooses the language and the rest get stuck with it.



The last thing I will say is that it is easier and more fun to learn a programing language if you have a project in mind because you will see your progress as you learn new things. Also, the language per se is not so important as learning how to program in general. Just like what brand hammer you use is not as important as knowing how to build the house.



P.S. you do not need to take a programing course but, it does help. I have self taugh myself C/C++, python, actionscript and perl. Java I learn most of it myself but I also took a course in college which is good because many other courses I took required it. Please oh please learn how to organized your code and use comments. Proper indentation and other programing standards to make your code readable.
tbshmkr
2009-01-11 16:21:13 UTC
Free Online Tutorial, Books, & Compiler

http://www.cplusplus.com

------

Free Electronic Book

Thinking in C++ 2nd Edition by Bruce Eckel

Volume 1 & Volume 2

http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

======

GNU GCC Setup

http://ems.calumet.purdue.edu/mcss/kraftrl/cs302-2005/mingw-install.html
anonymous
2009-01-11 18:38:56 UTC
For starters you need to download a compiler and debugger, I would reccomend Visual C++ Express Edition. This will allow you write, debug, and run your programs. Now you must know C++ will mainly deal with the comman prompt in the beginning and it will be tough to get past. There is alot of math involed so be ready. Stick with it and you'll get it though!



http://www.microsoft.com/express/vc/Default.aspx

http://www.cpluplus.com - good tutorials
Kasey C
2009-01-11 16:53:44 UTC
It's NOT C++ script, but C++ program.



If you just want to play around, Microsoft Visual C++ Express is right up your alley.



AND it's free.



---

Kasey C, PC guru since Apple II days

The gene pool could use a bit more chlorine.
anonymous
2009-01-11 16:14:27 UTC
Do you know any other programming language?? Do you just want the syntax for c++ or do you need to learn programming logic altogether?



The easiest answer(if you understand anything) is to open up notepad, type in your code, save the file as a .cpp file then compile it.



I have a feeling that you will not be able to do that however.



Your question is not quite specific enough.
Fudge
2009-01-11 18:36:59 UTC
learn Python instead ( it's used extensively for scripts and other cool stuff )



Download :

http://www.python.org/download/



Tutorials:

http://docs.python.org/tut/



good luck!
anonymous
2009-01-11 17:30:45 UTC
http://www.cprogramming.com/tutorial.html





http://www.cplusplus.com/doc/tutorial/





http://www.cs.wustl.edu/~schmidt/C++/



http://www.programmingtutorials.com/cplusplus.aspx





http://www.codersource.net/codersource_cppprogramming.html





http://www.makingcomputers.net/
?
2009-01-11 18:54:42 UTC
This might help. It includes both free editors and tutorials.
Ragz
2009-01-11 16:49:36 UTC
You can find the startup guide for c++ in this link



http://www.tinymsg.co.cc/cplusplus



Password: syshacks.com
anonymous
2009-01-11 17:55:58 UTC
the best to learn C++ is go to http://www.cprogramming.com

u can find source codes here: http://www.cprogramming.com/cgi-bin/source/source.cgi
anonymous
2009-01-11 18:55:15 UTC
http://www.microsoft.com/express
anonymous
2009-01-11 16:11:22 UTC
I hated c ++ visual basic is much better.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...