Tag: C Program
In the following C function, we can launch a command and capture its output and store in a 2 dimensional char array. The function returns the number of the …
In C/C++, we can use the clock_gettime method from time.h to get the Seconds and Nano Seconds. The following C runs the external command and measure the time difference: …
The ROT47 Cipher can be implemented in the following C/C++ Function. The ROT47 Cipher helps to encode/decode plain-text. #include <stdio.h> #include <string.h> void rot47(char *buf, int l) { for …
On command line, we want to reverse the parameters, we can compile the following C program to produce a exectuable. #include <stdio.h> #include <string.h> void reverse(char *buf, int i, …
Given a text string, we want to convert to their Hexadecimal representations. The following C program when compiled and run, takes the command line parameters, convert to ASCII code …