-
-
Write a function reverse which takes a strings as a parameter and prints it out in reverse.
Example:reverse (hello) prints out (olleh)
Output of ++i + ++i + i + --i?
What will be the output of ++i + ++i + i + --i when i=5?
Compiler says output is 27. How?Can a variable be both const and volatile?
Yes. The const modifier means that this code cannot change the value of the variable, but that does not mean that the value cannot be changed by means outside this code. For instance, in the example in FAQ 8, the timer structure was accessed through a volatile const pointer. The function itself did not change the value of the timer, so it was declared const. However, the value was changed by...
Can static variables be declared in a header file?
You can’t declare a static variable without defining it as well (this is because the storage class modifiers static and extern are mutually exclusive). A static variable can be defined in a header file, but this would cause each source file that included the header file to have its own private copy of the variable, which is probably not what was intended.
What is the difference between a string and an array?
An array is an array of anything. A string is a specific kind of an array with a well-known convention to determine its length. There are two kinds of programming languages: those in which a string is just an array of characters, and those in which it’s a special type. In C, a string is just an array of characters (type char), with one wrinkle: a C string always ends with a NUL character. The “value”...
C is not platform dependent.Why?
we know that C is not platform independent.but if we make a program on a operating system and copy the same program on other os without any changes then this program will run after compiling and will give the same answer.
so if same program will run on other os then why C is not platform independent.
C Pyramid Program
1
1 2 2
1 2 2 3 3
1 2 2 3 3 4 4
how to create this pyramid using cWhat is the difference between declaring a variable and defining a variable?
Declaring a variable means describing its type to the compiler but not allocating any space for it. Defining a variable means declaring it and also allocating space to hold the variable. You can also initialize a variable at the time it is defined.
Ans