Question:
Basic questions & answers on C++?
2007-07-20 10:41:36 UTC
I would like to know about all basic concepts of C++ PROGRAMMING & also about explaination of some important terms used in programming like -> Why we use word " #include<> " at the beigining of prog.
Five answers:
newton3010
2007-07-20 10:47:21 UTC
Not sure about the basic concepts...you write program, compile them and run them...



the #include line is a command that tels the compiler(the program that take sthe code and makes it a runnable file) to include this file as part of the code....standard inclused are the io.c and i beleive stdout.c the include file contane extra code to perform common functions instead if making you write it all the time.
rt11guru
2007-07-20 18:23:58 UTC
#include:



1. It is a good practice to break your code into multiple, small files to reduce complexity.



2. When you declare a class, structure, function, or constant, you want to do it exactly one place, so that if you change it, you only have to make one change.



3. The compiler builds one source code file at a time. When you use a class, structure, etc., the compiler needs the description to know how to build it. It needs to have that information contained in the file that it is compiling.



To make 1, 2, and 3, work together, you declare the class, structure, etc. in a file, known as a header file (usually named with .h extension, like myclass.h).



In every file that uses your class, structure, etc., you put a #include for the header file at the top of the code. When the compiler goes through you code, it copies the included file into the code file so that it has a local copy fo the header file and all the information it needs to do its job.
hac
2007-07-20 17:48:43 UTC
Basic Concepts: http://msdn2.microsoft.com/en-us/library/k1f45exx(VS.80).aspx



The expression foo->bar is used to acess the member bar of the structure or union that foo points to.



#include is part of the C++ preprocessor that adds to the current file the code from another. The < and > brackets mean that the file is in the standard library. Sorry if this is a bit confusing.



There are lots of tutorials on the web. Here's a couple: http://www.functionx.com/cpp/index.htm http://www.cplusplus.com/doc/tutorial/
aRe_yeS
2007-07-20 17:52:47 UTC
A book titled, "The C++ Programming Language" by Stroustrup or any C++ book by Stroustrup
teressaprincess
2007-07-20 17:51:38 UTC
www.cplusplus.com/doc/tutorial/



www.cprogramming.com/tutorial.html


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