-
string2: "def"
the occurrence of 'a' will be replaced by 'd' , 'b' will be replaced by 'e' , 'c' will be replaced by 'f'
AND for less complexity assume the string1 and string2 are of same size">Write a program to get strings and to substitute character from string1 to string2(equv to UNIX command tr)for example:string1: "abc"string2: "def"the occurrence of 'a' will be replaced by 'd' , 'b' will be replaced by 'e' , 'c' will be replaced by 'f'AND for less complexity assume the string1 and string2 are of same size
-
-
-
Can the size of an array be declared at runtime?
No. In an array declaration, the size must be known at compile time. You can’t specify a size that’s known only at runtime. For example, if i is a variable, you can’t write code like this: char array[i]; /* not valid C */ Some languages provide this latitude. C doesn’t. If it did, the stack would be more complicated, function calls would be more expensive, and programs would run a lot slower. If you...
-
-
-
-
-
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? ">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?
-
-
-
-
-
-
Is using exit() the same as using return?
No. The exit() function is used to exit your program and return control to the operating system. The return statement is used to return from a function and return control to the calling function. If you issue a return from the main() function, you are essentially returning control to the calling function, which is the operating system. In this case, the return statement and exit() function are similar....
-
What is a pointer variable?
A pointer variable is a variable that may contain the address of another variable or any valid address in the memory.
-
-
-
-
What is a pointer value and address?
A pointer value is a data object that refers to a memory location. Each memory locaion is numbered in the memory.The number attached to a memory location is called the address of the location.
C Interview Questions
Ans