Pointers in C++ are symbolic representations of addresses. They enable programs to simulate call-by-reference as well as to create and manipulate dynamic data structures. By using pointers we can get the first character of the string, which is the starting address of the string. As shown below, the given string can be accessed and printed through the pointers.@Algorithm_s1 #cpp
In this example, we will first slice the string up to the character that we want to delete and then concatenate the remaining string next from the deleted character. #python @Algorithm_s1
Exchange Values Using Tuples
One of the popular tricks in Python is to exchange values without creating a temporary variable. The method is applicable for any number of variables.
The right side of a sequence assignment statement allows any iterable objects to be specified. The main thing is that the number of elements on the left is equal to the number of elements on the right. This assignment also applies to complex nested structures.
@Algorithm_s1 #python
One of the popular tricks in Python is to exchange values without creating a temporary variable. The method is applicable for any number of variables.
The right side of a sequence assignment statement allows any iterable objects to be specified. The main thing is that the number of elements on the left is equal to the number of elements on the right. This assignment also applies to complex nested structures.
@Algorithm_s1 #python