Friday 31 August 2012

First C/C++ Executable or Binary File

If your C/C++ configuration is okay you can be able to create an executable file with any kind of a normal text editor e.g., notepad if you're using windows. An executable file is also a binary file in other words.For your information you do not need any specialized editor to do this.

Let's do an example;
  1. Open your text editor i.e., notepad and type the following code;
             #include <iostream>
             #include <string>
             using namespace std;

             int main(){
             string n ("User");
             cout << "Enter your name: ";
             getline(cin, n);
             cout << "\nWelcome to C++ programming, " << n << "!\n" << endl;

             return 0;}

     2.  Save this file as Hello.cpp or Hello.cc on your desktop (Note: It should not have any other extension).
     3.  Go to your shell or command prompt and change directory to desktop, e.g.,
           cd  C:\Users\RAWG\Desktop
    4.   Type the following;
           c++ Hello.cpp                   {to compile c++}
    5.    An executable will be created on your desktop "a.exe".
    6.    On your command prompt or shell type the file's name "a" i.e., a.exe.
    7.    It should ask for your name then display "Welcome to C++ programming, <name>!".
    8.    Do the same process for a C executable save it as "Hello.c".
           Here is the code for a C executable;
            #include <stdio.h>

            int main(void )
           {
            printf("Welcome to C programming!\n" );
            return 0;}
   9. On any other platform go to your shell and use your OS editor follow the instructions as above.

  



Sunday 26 August 2012

C/C++ Configuration

How to Configure C/C++ configuration on Debian 6;
  •  Download the respective GNU Linux c/c++ compiler archives namely,  gcc-core-3.4.5 and gcc-g++-3.4.5
  • Go to your shell or terminal and you'll need to a super user or root to install this.
  • On the terminal change directory to where the repositories or archives are located.
  • Type on the terminal cd <directory of archives> i.e., cd /home/rawg/Desktop 
  • Install using the following commands  apt-get install gcc-core and apt-get install gcc-g++ to install both C and C++ compilers.
To test if am right type c++ --version on the terminal  you should see your version of the compiler if it is successful.

On windows;
  1. First you need to be connected to the Internet 
  2. Download GNU's compilers either cygwin or mingw.
  3. Install one compiler
  4. Go to the installation directory of the compiler e.g., C:\MinGw\bin
  5. You'll need to copy the bin directory to your Path as I have done for Java compiler.
  6. Follow the same steps as the  Java configuration

Sunday 5 August 2012

Judge's Case Ruling on Google's android

Google's Android OS which is known to be written from the Java programming language(owned by Oracle), accused of using Java's APIs by Oracle. The judge's ruling about the case was Java's APIs aren't copyrighted or patented so Google was allowed to use Java API's in it's android system.Oracle also litigated Google last year which still Google won the lawsuit, Oracle is said to have lost billions of dollars.Oracle which still appears to relentless in the battle against Google.