If I want to initialize the array like.
int a[5] = {0};
then it gives me all element 0.
but if i give int a[5] = {5};
then 5 0 0 0 0 is ans.
what will I do for all element 5 5 5 5 5 in a single
statement???

Answer Posted / litan parida

int a[1000];
memset(&a,0,sizeof(a))

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5463


Where can I get an ansi-compatible lint?

642


diff between exptected result and requirement?

1594


How do you convert strings to numbers in C?

710


What do header files do?

603






Explain how many levels deep can include files be nested?

626


Can a local variable be volatile in c?

575


can anyone please tell about the nested interrupts?

1678


Can the sizeof operator be used to tell the size of an array passed to a function?

620


please give me some tips for the placement in the TCS.

1632


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

645


a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

637


How can I use a preprocessorif expression to ?

601


Write program to remove duplicate in an array?

600


What is c programming structure?

620