This document provides instructions for installing and using Code::Blocks, a free open source C++ IDE. It discusses downloading and installing Code::Blocks on Windows, Linux and Mac operating systems. It then demonstrates how to create and build a basic C++ console application project within Code::Blocks, edit and run the code, and debug programs using the integrated debugger. The document also provides tips on sharing projects between computers and includes an appendix with more detailed Linux and Mac installation instructions.
For most programming/scripting languages the concepts are all the same. The only thing that changes is the syntax in which it is written. Some languages may be easier to remember than others, but if you follow the basic guide line, it will make learning any programming language easier. This is in no way supposed to teach you everything about programming, just a general knowledge so when you do program you will understand what you are doing a little bit better.
Concept of file, Opening and closing of file, Modes, Input/ output function, Random access in file, Printing a file
A file represents a sequence of bytes on the disk where a group of related data is stored. File is created for permanent storage of data. It is a ready made structure.
In C language, we use a structure pointer of file type to declare a file.....
For most programming/scripting languages the concepts are all the same. The only thing that changes is the syntax in which it is written. Some languages may be easier to remember than others, but if you follow the basic guide line, it will make learning any programming language easier. This is in no way supposed to teach you everything about programming, just a general knowledge so when you do program you will understand what you are doing a little bit better.
Concept of file, Opening and closing of file, Modes, Input/ output function, Random access in file, Printing a file
A file represents a sequence of bytes on the disk where a group of related data is stored. File is created for permanent storage of data. It is a ready made structure.
In C language, we use a structure pointer of file type to declare a file.....
DISCLAIMER: This Presentation is made for educational purposes only.
Introduction to Computer Programming, Computer Language, History of Computer Language, Hierarchy of High-Level Languages, Algorithm, Data Types and Arduino
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
loader and linker are both system software which capable of loads the object code, assembled by an assembler, (loader) and link a different kind of block of a huge program. both software works at the bottom of the operation (i.e. closer to the hardware). in fact, both have machine dependent and independent features.
DISCLAIMER: This Presentation is made for educational purposes only.
Introduction to Computer Programming, Computer Language, History of Computer Language, Hierarchy of High-Level Languages, Algorithm, Data Types and Arduino
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
loader and linker are both system software which capable of loads the object code, assembled by an assembler, (loader) and link a different kind of block of a huge program. both software works at the bottom of the operation (i.e. closer to the hardware). in fact, both have machine dependent and independent features.
For more course tutorials visit
www.newtonhelp.com
Lab 1 of 7: Getting Started (Your First C++ Programs) Lab Overview - Scenario/Summary
Welcome to Programming with C++. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C++ program.
For more course tutorials visit
www.newtonhelp.com
Lab 1 of 7: Getting Started (Your First C++ Programs) Lab Overview - Scenario/Summary
Welcome to Programming with C++. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C++ program.
CIS 170 Imagine Your Future/newtonhelp.com bellflower42
For more course tutorials visit
www.newtonhelp.com
Lab 1 of 7: Getting Started (Your First C++ Programs) Lab Overview - Scenario/Summary
Welcome to Programming with C++. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C++ program.
C++ was developed by Bjarne Stroustrup, as an extension to the C language. cp...bhargavi804095
C++ is a cross-platform language that can be used to create high-performance applications.
C++ was developed by Bjarne Stroustrup, as an extension to the C language.
C++ gives programmers a high level of control over system resources and memory.
For more course tutorials visit
www.newtonhelp.com
Lab 1 of 7: Getting Started (Your First C++ Programs) Lab Overview - Scenario/Summary
Welcome to Programming with C++. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the
For more classes visit
www.snaptutorial.com
Lab 1 of 7: Getting Started (Your First C++ Programs)
Lab Overview - Scenario/Summary
Welcome to Programming with C++. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C++ program.
Cis 170 c Enhance teaching / snaptutorial.comHarrisGeorg51
Lab 1 of 7: Getting Started (Your First C++ Programs)
Lab Overview - Scenario/Summary
Welcome to Programming with C++. The purpose of this three-part lab is to walk you through the following tutorial to become familiar with the actions of compiling and executing a C++ program.
In general, this lab will instruct you on:
1. how to create a project;
2. how to enter and save a program;
Welcome to the exciting world of IoT! In this presentation, we'll uncover the latest advancements in this field and explore their impact on the world around us.
Welcome to the exciting world of the Internet of Things! In this presentation, we'll explore the ins and outs of IoT and discover what makes it such a fascinating and rapidly growing field.
Here are tips on how to prevent malware from infecting your computer, keeping your hardware safe.
Install Anti-Virus/Malware Software.
Keep Your Anti-Virus Software Up to Date.
Run Regularly Scheduled Scans with Your Anti-Virus Software.
Keep Your Operating System Current.
Secure Your Network.
Think Before You Click.
List of Channels & their Composition
Terms & Conditions
These rates (MRP/DRP) will be effective from 29th Dec’18.
NCF = Rs.130* for first 100 SD channels and Rs.20* for every additional channels thereof.
*taxes Extra.
1 HD Channel = 2 SD Channels
MRP & DRP are same.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Modern design is crucial in today's digital environment, and this is especially true for SharePoint intranets. The design of these digital hubs is critical to user engagement and productivity enhancement. They are the cornerstone of internal collaboration and interaction within enterprises.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
How to Position Your Globus Data Portal for Success Ten Good PracticesGlobus
Science gateways allow science and engineering communities to access shared data, software, computing services, and instruments. Science gateways have gained a lot of traction in the last twenty years, as evidenced by projects such as the Science Gateways Community Institute (SGCI) and the Center of Excellence on Science Gateways (SGX3) in the US, The Australian Research Data Commons (ARDC) and its platforms in Australia, and the projects around Virtual Research Environments in Europe. A few mature frameworks have evolved with their different strengths and foci and have been taken up by a larger community such as the Globus Data Portal, Hubzero, Tapis, and Galaxy. However, even when gateways are built on successful frameworks, they continue to face the challenges of ongoing maintenance costs and how to meet the ever-expanding needs of the community they serve with enhanced features. It is not uncommon that gateways with compelling use cases are nonetheless unable to get past the prototype phase and become a full production service, or if they do, they don't survive more than a couple of years. While there is no guaranteed pathway to success, it seems likely that for any gateway there is a need for a strong community and/or solid funding streams to create and sustain its success. With over twenty years of examples to draw from, this presentation goes into detail for ten factors common to successful and enduring gateways that effectively serve as best practices for any new or developing gateway.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
How Does XfilesPro Ensure Security While Sharing Documents in Salesforce?XfilesPro
Worried about document security while sharing them in Salesforce? Fret no more! Here are the top-notch security standards XfilesPro upholds to ensure strong security for your Salesforce documents while sharing with internal or external people.
To learn more, read the blog: https://www.xfilespro.com/how-does-xfilespro-make-document-sharing-secure-and-seamless-in-salesforce/
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
CyanicLab, an offshore custom software development company based in Sweden,India, Finland, is your go-to partner for startup development and innovative web design solutions. Our expert team specializes in crafting cutting-edge software tailored to meet the unique needs of startups and established enterprises alike. From conceptualization to execution, we offer comprehensive services including web and mobile app development, UI/UX design, and ongoing software maintenance. Ready to elevate your business? Contact CyanicLab today and let us propel your vision to success with our top-notch IT solutions.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I didn't get rich from it but it did have 63K downloads (powered possible tens of thousands of websites).
Why React Native as a Strategic Advantage for Startup Innovation.pdfayushiqss
Do you know that React Native is being increasingly adopted by startups as well as big companies in the mobile app development industry? Big names like Facebook, Instagram, and Pinterest have already integrated this robust open-source framework.
In fact, according to a report by Statista, the number of React Native developers has been steadily increasing over the years, reaching an estimated 1.9 million by the end of 2024. This means that the demand for this framework in the job market has been growing making it a valuable skill.
But what makes React Native so popular for mobile application development? It offers excellent cross-platform capabilities among other benefits. This way, with React Native, developers can write code once and run it on both iOS and Android devices thus saving time and resources leading to shorter development cycles hence faster time-to-market for your app.
Let’s take the example of a startup, which wanted to release their app on both iOS and Android at once. Through the use of React Native they managed to create an app and bring it into the market within a very short period. This helped them gain an advantage over their competitors because they had access to a large user base who were able to generate revenue quickly for them.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
First Steps with Globus Compute Multi-User EndpointsGlobus
In this presentation we will share our experiences around getting started with the Globus Compute multi-user endpoint. Working with the Pharmacology group at the University of Auckland, we have previously written an application using Globus Compute that can offload computationally expensive steps in the researcher's workflows, which they wish to manage from their familiar Windows environments, onto the NeSI (New Zealand eScience Infrastructure) cluster. Some of the challenges we have encountered were that each researcher had to set up and manage their own single-user globus compute endpoint and that the workloads had varying resource requirements (CPUs, memory and wall time) between different runs. We hope that the multi-user endpoint will help to address these challenges and share an update on our progress here.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
1. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 1
About CodeBlocks
Code::Blocks is a free C++ IDE built to meet the most +demanding needs of its users. It is designed to
be very extensible and fully configurable.
Features
Highlights:
• Open Source! GPLv3, no hidden costs.
• Cross-platform. Runs on Linux, Mac, Windows (uses wxWidgets).
• Written in C++. No interpreted languages or proprietary libs needed.
• Extensible through plugins
Compiler:
• Multiple compiler support:
o GCC (MingW / GNU GCC)
o MSVC++
o Digital Mars
o Borland C++ 5.5
o Open Watcom
o ...and more
• Very fast custom build system (no makefiles needed)
• Support for parallel builds (utilizing your CPU's extra cores)
Multi-target projects
• Workspaces to combine multiple projects
• Inter-project dependencies inside workspace
• Imports MSVC projects and workspaces (NOTE: assembly code not supported yet)
• Imports Dev-C++ projects
2. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 2
Introduction
Through the aid of a compiler, a program written in a computer language, such as C++, is turned into
machine code, which is executed on the computer.
The purpose of this manual is to help the student develop the skills to organize program coding and
develop sound techniques for finding and isolating errors.
Here you will learn how to trace the code step by step, so that it becomes clear where the problem is
and why your program does not execute properly. This is called debugging the program. Hand tracing is
useful in helping beginners understand where the bugs are and correct the program appropriately.
Automatic tools have also been developed to help you trace programs that you have written and will be an
important tool as your programs become more complex. This type of tool is called a debugger.
A debugger lets you pause a program, while it is in the middle of running, and watch what is going on.
Some debuggers work as command-line line debuggers, but newer debuggers have a nice graphical user
interface, which is useful in helping you watch variables that you have defined as the program executes.
The graphically- based debugger environment is part of what is called the Integrated Development
Environment (IDE).
A debugger cannot solve your problems for you. It is merely a tool to assist you when programming.
You should first attempt to read over your code and using paper and pencil analyze the code to get an
understanding of what is going on. Once you have gotten an idea of where in your code you have an error,
you can then set the debugger to watch certain variables in your program. Watching your code will show
you step by step how your program is being executed.
The debugger that you will use is part of an Open Source free IDE called Code::Blocks, which we
have found easy to use and is described in these notes. Code::Blocks has a C++ editor and compiler. It
will allow you to create and test your programs from one easy to use application. We hope these notes will
assist you in making programming more enjoyable and help you develop better programming skills.
You may find additional information regarding Code::Blocks at: http://www.codeblocks.org/
A complete manual for Code::Blocks is available here: http://www.codeblocks.org/user-manual
3. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 3
Installation of Code Blocks
Step 1: Get the Software
In order to install the Code::Blocks IDE as well as the compiler, pick the one from the accompanying
CDROM as per the operating system you are using. You will get the installer application in the folder of
appropriate OS on the CDROM.
Open the folder and proceed with the instructions. In this section, we are covering the installation of
Windows based Code Blocks software.
If you are using Mac OS X or Linux, please see Appendix I for installation instructions.
Step 2: Install the Software
Next, open (click on) CodeBlocks install file and the CodeBlocks Setup will begin installing as
follows:
Click Next.
4. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 4
Select I Agree
.
Take the default settings by pressing Next
5. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 5
Take the default folder to install CodeBlocks to and then select Install.
6. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 6
Using Code::Blocks
This section explains how to create a console project, which is suitable for basic C++ programs that
use the console (keyboard input and text output) for a user interface. The example screenshots in this
section are from a Windows installation. Macintosh users may see slightly different screens, but the
commands should be identical.
For each new program, you’ll need to create a project. A project will contain your source code,
generated executables and various configuration files within a single folder.
1. From the Start Here screen, click on Create a new project. You can also start from the main
menu using the command : File New Project .
2. Select "Console application" and press "Go".
7. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 7
3. Select "C++" as the language you want to use and press "Next".
8. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 8
4. The next screen asks you to name your project and select a location for your project. Be sure you place the
project in an easy to find location
and give it a meaningful name, so
that you can find it again later.
For this example, the project
has been created in the directory
C:codeblocks-tutorial, with name
first-project.
5. The next screen sets up the compiler and configuration for the project. Select the GNU GCC Compiler and
be sure that both the Debug and Release check boxes are selected. Press Finish to create your project.
9. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 9
6. This will create a new folder for the project within the location folder you selected. You can verify the
location of the project by navigating to the appropriate directory. For example:
When the project is initially created, it will contain two files. The .cbp file is the Code::Blocks project file, which
can be used to reopen the project later. The .cpp file is the C++ program file that you will edit to create your
program.
7. Expand the tree in the Projects tab to the left of the Code::Blocks window and double click on main.cpp
to load the program file into the editor.
10. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 10
8. Edit the code to create your program. As you are working periodically save your changes (main
menu:: File Save all files . You can also save all files with the short cut CTRL-SHIFT-s , or save a single
file with the short cut CTRL-s .
9. Build the project to compile your program into an executable. Use the Build menu and select
Build (or press CTRL-F9 ).
11. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 11
10. Check for error messages in the lower window. If there are errors, return to step 8 and correct
them. If there are no errors, proceed to step 11.
11. Run your program. main menu :: Build Run (or press CTRL-F10 ).
12. If the program runs as expected, you’re finished. If it does not run as expected, return to step 8
and correct your program.
12. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 12
Capturing Program Execution
This section is specific to Windows installations.
Most assignments will require you to capture a snapshot of the program’s console. Do this at the end
of program execution, before closing the console.
1. The console will remain open until you press some key to close it. It should look similar to this:
2. Right-click the mouse anywhere in the black console area. To capture the entire output of the
program, choose Select All . To capture only part of the output, choose Mark, then drag your
mouse over the area you want to copy. In either case, the selected area will turn white.
13. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 13
3. Press the Enter key to copy of the selected text to the Windows copy/paste buffer.
4. Return to the edit window for your program. Add a comment at the bottom of your program and
paste the text (CTRL-v) into that comment. Build and run the program to verify that the comment is
correct and then save the file.
Saving and Restoring Projects
If you are working on a machine other than your own, you’ll need to take a copy of your project(s)
with you. To do this, simply locate the folder containing your project and copy it to a removable disk, or
to your network storage space. You can also archive the project folder as a zip file and email it to
yourself.
To save space, you may want to remove unnecessary contents before copying or archiving your file.
The bin and obj folders inside your project folder can both be safely deleted, since the contents of these
folders will be recreated the next time you build your project.
The most important files are your source code (any .cpp or .h files that you have written). If you keep
these files, it is possible to recreate your project by adding them to a new Code::Blocks project later.
14. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 14
If you need to return to work on a previous project, start Code::Blocks and load the old project. From
the main menu, select File Open , then navigate to your project folder and locate the .cbp file. Select
the .cbp file and press Open and you’ll be returned to the editing environment for your project. Return
to step 8 in the section Using Code::Blocks and continue working.
Short Alternative
To quickly type and run a simple C++ program, you do the following:
1. Click File New Empty File or press Ctrl+Shift+N
2. Type your code in the blank window that opens.
3. Click File Save File or press Ctrl+S.
4. Type the full name of your program file in double quotes (along with extension .cpp) e.g. to
save a file with name First, save it as “First.cpp”
5. Now compile and run your program by clicking Build Build and Run or by pressing F9.
15. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 15
Appendix A
Installation of Code::Blocks for Mac OS X and Linux
If you are using the Mac OS, you will need to do the following:
Pre-Install steps:
Here is a step by step instruction file for setting up X11 and XcodeTools for the Mac.
1. Make sure that X11 is installed in your system (check in your Application menu). If not, you'll need
to install it from your Mac OS disc.
Insert the disc and find the optional packages installer, open it, check the X11 box, and install from that.
If you are using 10.1 through 10.3, you can download X11 from Apple.
2. Install Developer Tools: You may be able to skip this step, if you are using Mac OS X 10.4
Tiger and have installed the Developer tools.
As a test, open up xterm. You cannot use terminal with Code Blocks. Xterm is part of X11 and that is
why you'll need to have X11 installed.
Run the command gcc. If you get an error that there are no input files, that means gcc exists and you are
good to go. If you get an error saying the command is not found, you need to install the Developer Tools.
If you need to install the Developer tools, you can download them from Apple, or you can install them
from your Mac OS disc. Locate the Xcode installer on the installation discs and double click to install.
Check your discs for Xcode or Developer Tools.
Run the installer and install everything other than the documentation:
• For Mac OS X 10.3, you need to install Xcode Tools version 1.2 or later
• For Mac OS X 10.4, you need to install Xcode Tools version 2.2 or later
• For Mac OS X 10.5, you need to install Xcode Tools version 3.1 or later
16. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 16
Installation for Fedora 8 Linux:
Installing Code::Blocks
In a console window, become root and then execute the following command:
yum install codeblocks
Running Code::Blocks
In the Applications Pull Down Menu, go to Programming and click on: Code::Blocks IDE
or
Open a console window and then execute the following command:
codeblocks
Installation for Ubuntu Linux:
Installation Instructions From:
http://forums.codeblocks.org/index.php/topic,8208.msg61085.html#msg61085
1) Add the repositories to /etc/apt/sources.list:
Open the file with a graphical editor as root. Paste the following line in a terminal:
gksu gedit /etc/apt/sources.list
Paste this at the end:
# codeblocks
deb http://lgp203.free.fr/ubuntu/ gutsy universe
# wx widgets
deb http://apt.wxwidgets.org/ gutsy-wx main
Note: Depending on what version of Ubuntu you are using, in step 1 you
may need to replace gutsy with feisty.
17. C o d e B l o c k s T u t o r i a l – C o m p u t e r S c i e n c e C + + b y S u m i t a A r o r a Page 17
2) To make sure your package system trusts these sources. Add their keys.
Enter these two lines at the terminal:
wget -q http://lgp203.free.fr/public.key -O- | sudo apt-key add -
wget -q http://apt.wxwidgets.org/key.asc -O- | sudo apt-key add -
And update the packages by entering the following lines on the terminal:
sudo apt-get update
sudo apt-get upgrade
3) Install Code::Blocks
Enter the following line in the terminal:
sudo apt-get install libcodeblocks0 codeblocks libwxsmithlib0
codeblocks-contrib
You are able to step 3 whenever you want you to get the latest nightly build.
You should see Code::Blocks in the Programming Languages listing of your programs.