Char str[]="DOLLAR";Here , you have the base address of array i.e. str.By using only one pointer variable, you have to replace the occurrence of 'L' with '$$'. (after replacement, it should be DO$$$$AR)can any body suggest efficient method?
Latest Answer : No ,its not possible to have a dynamic array without using calloc,malloc or without ptr.... Why u want to know abt it? but u can achieve a array without specifying size say arr[]; but its not efficient as when u use this array..more space will ...
Latest Answer : Dangling pointer is a pointer which is pointing to the destroyed object or which does not have proper address. A pointer should be intialized to zero once it is freed after allocating memory to that pointer. Ex: main() { ...
1) If either operand of an arithmetic operator is unsigned long, the other operand is promoted to unsigned long. 2) If either operand of an arithmetic operator is unsigned int, the other operand
Latest Answer : Here we cant say the default promotion without knowing the other operand.But if two operands are of different datatypes and the arithmetic operation is performed on these operands the compiler allocates the memory of higher datatype for the resulting ...
Latest Answer : Pointers to functions concept is used in C programming language in various instances. One of the common instance in which programmers use pointers to function concept is for passing pointers to a function as the name implies.For example the below declares ...
What is function pointer in C program?
Latest Answer : Each pointer will point to a data type like integer, float etc., similar to these pointers we can also have some special pointers that point to the memory location of the functions and these pointers are named as function pointers ...
How to find the address of a variable which is declared as long double?
Latest Answer : #iinclude void main(){ double &x; *x=5.5; printf("Address = %u",x); }Try This. ...
What is NULL Macro? What is the difference between a NULL Pointer and a NULL macro?
What is the purpose and use of function pointers?
Latest Answer : Function pointer holds the address of a function. Every function has a address. We can call the function by calling the function pointer. ...