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
Can we access array using pointer in c language?
Describe explain how arrays can be passed to a user defined function
When do we get logical errors?
Write a program to print factorial of given number without using recursion?
What library is sizeof in c?
Tell me about low level programming languages.
What are the advantages and disadvantages of a heap?
Which is better malloc or calloc?
What is the difference between union and anonymous union?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Write a Program to accept different goods with the number, price and date of purchase and display them
All technical questions
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
What is signed and unsigned?
What is enumerated data type in c?