In this occasion we prototype, define and call the print_always_7() and sum() functions.
We review some basic function concepts like return and parameter types, prototype checking and calling a function that returns a value so that it is assigned to a local variable.
Programming is easy, when you know how to learn it.
Friday, April 29, 2011
Wednesday, April 20, 2011
Study skills for programmers
Promoting these video series so that I get more interest in study skills and computer programming in general, more affluence for my blog and youtube channel. but most importantly to share.
Today I am also adding a donate button with the only intention to allow the learner to contribute monetarily so that this project is kept alive. Stop supporting huge billionaire academic corporations and start embracing Open Source Software and Documentation. It's noble, fair, and serves the people at its core. It's a symbiosis that can work.
Today I am also adding a donate button with the only intention to allow the learner to contribute monetarily so that this project is kept alive. Stop supporting huge billionaire academic corporations and start embracing Open Source Software and Documentation. It's noble, fair, and serves the people at its core. It's a symbiosis that can work.
Saturday, March 5, 2011
Functions in pseudo-code
Functions are code blocks that execute where the function call is placed in the code. That could be inside the main function, inside another function that is called inside main, inside another function that is called inside another function that is called inside main, and so on.
Function prototypes serve the builder to inform a priori what types(how much allocation must be made and how must it be divided) does the function return and receive(as parameters).
Function definitions serve to specify the code to be executed, when the function call is encountered in the code.
Function prototypes serve the builder to inform a priori what types(how much allocation must be made and how must it be divided) does the function return and receive(as parameters).
Function definitions serve to specify the code to be executed, when the function call is encountered in the code.
Span of statements
We check the behaviour of the builder(GCC from the MinGW project) in regards to line separations amidst statements. First it is separated at white-spaces between tokens(no problem), then amidst a string literal(compilation problem) and finally we divide the string literal into two string literals, which works.
Line by line explanation
We take time to scrutinize the code that we previously wrote, line by line, reviewing and understanding what each line prominently does.
If statement
The if clause is useful in that allows bifurcations : true and false tracks. If the if expression evaluates to non-zero(1, 20, -5, 0.3202), the true track is chosen by the computer's processor. If the if expression evaluates to zero(0), the false track is chosen.
Pseudo code is firstly used, then the actual C syntax replaces the pseudo code, and finally the application is built and run.
Pseudo code is firstly used, then the actual C syntax replaces the pseudo code, and finally the application is built and run.
Comment usage
Comments are useful for education materials, that is documentation, manuals, tutorials, references, etc. becuase they allow in-code, to explain in further detail each successive line(or group of lines), in the syntax and general logic of the application.
Also, how a library works, how the program is supposed to be used or expanded from the user programmer's perspective, etc.
The two types of comments in C are:
/* C classic comment
May span multiple lines*/
// C++ derived comment, endures up until a newline is encountered(up until the end of the line)
Also, how a library works, how the program is supposed to be used or expanded from the user programmer's perspective, etc.
The two types of comments in C are:
/* C classic comment
May span multiple lines*/
// C++ derived comment, endures up until a newline is encountered(up until the end of the line)
Friday, February 25, 2011
Variables definitions
The firstCprogram.c is changed. We define variables and extract(by evaluation of the rvalues) and output to the standard output the values held in them. The "equals"(=) sign is not to be confused with mathematical equality but it is an assignment being done from the rvalue token to the lvalue token. A very succinct explanation of printf is present. 3 programs are used for editing the file, the old edit.exe from the 16-bit era, notepad.exe, the classic ASCII encoded text editor, and Code:Blocks (where the keyword highlight feature is present)
Batch commands
We familiarize ourselves with certain batch commands like cd (change directory), md (move directory), cd .. (move one level backwards in the directory tree), del (delete files) and so on. We manually set our environment so that the files are in the correct place (01 folder inside the MinGW_exercises folder).
First C program built (from terminal)
We modify the command line window(cmd.exe) properties so that the width allows more space to be viewed without cropping the line. Quick Edit Mode checkbox is selected. We change and create some directory names so that the projects compiled with Code::Blocks are separate from those compiled directly at the command line. The firstCprogram.c is passed as the first argument to the GCC builder at the command line.
Monday, February 14, 2011
Code::Blocks setup and test
In this occasion we solve Code::Blocks 8.02 missing the compilation.
We change the mingw32-g++.exe to mingw32-gcc.exe at the linker tool place-holder. Preprocessing, compilation and linkage is done correctly this time.
We change the mingw32-g++.exe to mingw32-gcc.exe at the linker tool place-holder. Preprocessing, compilation and linkage is done correctly this time.
Code::Blocks setup
In this occasion, we set MinGW as the default compiler for the IDE, and a compilation attempt is performed.
Monday, January 24, 2011
Downloading Code::Blocks
In this video I show you how to download Code::Blocks from the world wide web. Code::Blocks is an Open Source and free Integrated Development Environment for C and C++, with support for lots of plug-ins.
Our purpose to use Code::Blocks is to show that IDEs(Integrated Development Environments) quicken the workflow for programmers but are not absolutely necessary to build programs(MinGW is necessary). The editor (which is a part of the IDE) will prove useful early on this video series.
Our purpose to use Code::Blocks is to show that IDEs(Integrated Development Environments) quicken the workflow for programmers but are not absolutely necessary to build programs(MinGW is necessary). The editor (which is a part of the IDE) will prove useful early on this video series.
setting up MinGW
In this video I aim to show the audience how to set up MinGW so that we can easily compile with the command line tools and Code::Blocks(Integrated Development Environment) alike.
Downloading MinGW
In this simple educational video, I show you how to download from the official website MinGW, which stands for Minimalist GNU for Windows. It is open source software that uses some GNU and Microsoft libraries to build C (and other languages as well) programs.
Subscribe to:
Posts (Atom)