Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Can someone guide me through one of the steps of this tutorial...?

(1/2) > >>

Hello, I have gone onto a tutorial. (I am a total newbie, I started today).

When that page above states 'Returning to the main source (main.cpp) include the header file and replace the cout function to match the new setup of the project.


I do not understand it that bit... please can someone just explain that step for me? I.e. what I do. I have followed every other step and I do not achieve the end result, like the tutorial states.

A little help please for a newb?


PS if this post is in the wrong place, please inform me and tell me where I need to put it, and I will move it, or a mod can move it but please let me know. Thank you.

Miguel Gimenez:
This board is only for C::B development, you should use "Using Code::Blocks".

Stop the tutorial when arriving to Changing file composition, get familiar with this basic project (modifiy, add code...) and get back to the tutorial when you are more experienced.

Locate the main.cpp file:
Find the file named main.cpp in your project. It's likely a source code file where the main logic of your program resides.

Include the Header File:
Look for an instruction or mention of a specific header file to include. It might look something like #include "filename.h". Add this line at the top of your main.cpp file, typically below any existing #include statements.

For example:

#include "your_header_file.h"
Replace the cout Function:
The instruction might be asking you to modify the cout function or replace it with something else. Look for a line in your main.cpp file that uses cout to output something to the console. Replace or modify this line according to the instructions.

For instance, if the original line is:

cout << "Hello, World!" << endl;
And the instruction suggests a change, you might modify it to something like:

customOutputFunction("Hello, New Setup!");
(Note: The actual changes will depend on the specific instructions given in your tutorial.)

Save the Changes:
After making these modifications, save the main.cpp file.

Build and Run:
Depending on your development environment, you might need to build or compile your project. After that, run it to see the effects of the changes you made.

BOT, the development environment is CB!!!!


[0] Message Index

[#] Next page

Go to full version