Friday, September 1, 2017

Quick post: [termux] C and C++/Cpp code execution

Everybody here are the steps to start c/c++ coding in termux

1) Install package using following command

apt-get install clang

2) Sample C code
#include <stdio.h>                                                    int main(){                                        
printf("Hello World!");              
return 0;
}

3) Run using
gcc helloWorld.c

4) View output using
./a.out

5) Sample cpp/c++ code
#include <iostream>                                            using namespace std;                                          
int main() {
std::cout << "Hello, World!";
    return 0;                                         
}

6) Running cpp code
g++ helloWorl.cpp

7) View output using
./a.out

No comments:

Post a Comment

Quick setup Phonegap Development Environment using Docker

INTRO NOTE : Pre-requisite is to have ubuntu 16.04 Following DIGITAL OCEAN tutorial for same...