| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help on projects
Hi all, I am new here
I recently started learning Win32 programming. I am very much confsed with the projects. I want to know how these projects work? What is their use? Many of the examples I have are based on these projects, I am only familiar with single .cpp files, but there are many cpp files in a single project. I need some help please. ![]() |
|
#2
|
||||
|
||||
|
If a program gets bigger, it may be easy to spread it out over multiple files, instead of having one cpp of thousands of lines. You might for example have seperate files for the user interface, the file handling, the logic, etc.
A project is a way to keep these tidy in your IDE, and make it easier to build the whole project (the IDE's compiler knows which files it has to compile).
__________________
This is my code. Is it not nifty? "The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools." ---Douglas Adams Join the Itsacon fanclub! Zero Tolerance: Spammers banned so far: 280
![]() |
|
#3
|
|||
|
|||
|
Most Common use:
Have you ever seen the credits of a program? If so, you might have noticed a lot of programmers involved. To prevent getting confused about who did "this and that" on a file, they usually break it down into different pieces, and each programmer is assigned a different piece. Of course, the pieces don't run by themselves, so they need to be combined on a project. As Itsacon implied, instead of having many pieces you could have a single file with hundreds of lines, making it very difficult to find and edit or debug stuff. |
|
#4
|
|||
|
|||
|
for example a program maybe broken up into 3 parts, headers/definitions/main driver program
for example : file.h could include or basic prototypes or headers or structs ----------------- #include<iostream> #include<string> using namespace std; class two { public: print(); two(); Private: int one; int two; }; --------- definitions.cpp - -------------- define your functions here... --------------- main.cpp - ---------- #include "file.h" // be sure to include path if not in the same folder #include "definitions.cpp" int main() { print(); return 0; } --------- why do this you ask? say your program has 50 different functions, u could break it up into different .cpp files so debugging would make it worlds easier instead of scrolling all the way down 1,000+ lines of code to fix a missing semi colon |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > Help on projects |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|