What is the benefit of using #define to declare a constant?
Answer / Shamee Ahmad
Using #define in C allows you to create constants that can be used throughout your code. This can increase readability, make your code more maintainable, and potentially reduce compile times because the preprocessor replaces the define with its value before compiling.
| Is This Answer Correct ? | 0 Yes | 0 No |
In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
When do we get logical errors?
what is the diff between the printf and sprintf functions?? and what is the syntax for this two functions ??
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
The differences between Windows XP and Windows Visa
What is the need of structure in c?
a=5 a=a++/++a
why effort estimation is important?
#include<stdio.h> int main(){ int i=10; int *ptr=&i; *ptr=(int *)20; printf("%d",i); return 0; } Output: 20 can anyone explain how came the output is 20
What are the disadvantages of external storage class?