Posts

Showing posts from March, 2023

String Handling in C++

Image
  C++ Strings String It is a set of characters (group of characters) arranged in sequential memory location In c/c++, there is no specific built-in data type point to string type  We can perform various operations on strings such as Comparing Joining Reversing Indexing and many more, etc,...  C++ supports two types of strings. They are C Style String (Character Array) String Class. 1. C STYLE STRING In c style string, the string is group of characters terminated with null character It will be created either character array or character pointer Example 1 – String Declaration      char name[50]; Example 2 – String Definition      char name[]=”Hello”; Here, the array name will hold the values “Hello” with additional null character \0 which is automatically added by the compiler (unlike c) Memory Representation      I. EXAMPLE OF C STYLE STRING 1. SOURCE CODE #include <iostream> using namespace std; int main() {     cout<<"----------------------------------------\n&

For Loop in Bash Script (Shell Scripting)

Image
Tamizh Tech Tutorial For Loop in Bash Script  (Shell Script) Shell Scripting Tutorial For Loop It is an example of looping statement and alternative for while loop It is used to execute group of statements based on the looping condition Bash supports several examples of for-loops. Some of them below Simple for loop Range based for loop C Style based for loop Infinite for loop. 1. Simple for loop (Data based for loop) Here the loop is based on the data or collection. The data can be the same type or different type. Syntax f or variable in data do # code done Where, variable is an user defined variable. Example 1 - Data based for loop Source Code echo "--------------------------------" echo -e "\t Data based For Loop" echo "--------------------------------" for i in 12 true "Hello" 34.55 do     echo " $i" done Output 2. Range Based for loop Here the loop is based on the three attributes like start, stop and interval . These a

xeyes Command in Linux | Funny Linux Command

Image
  Tamizh Tech Tutorial Xeyes command in Linux Linux Commands Tutorial This is the graphical eyes, which follows the mouse movement It is used to move the mouse pointer motion Note By default, this command is not installed on the machine. So we need to install it before to use based on the linux distribution Syntax xeyes Example

2 Linux Tips for Decompressing File in Unix / Linux

Image
  Tamizh Tech Tutorial 2 Linux Tips for Decompressing File in Unix / Linux Linux Tips Here you can find two tips to decompress the already compressed file in unix / linux terminal with examples. They are Using gzip command Using gunzip command 1. Using gzip Command with option -d This command with option -d is used to decompress the compressed file. Syntax gzip -d file.gz Example 2. Using gunzip Command This command will be used to decompress the file without taking option in linux / unix terminal. Syntax gunzip file.gz Example Tamizh Tech Tutorial