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
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What are comments and how do you insert it in a C program?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
Is there anything like an ifdef for typedefs?
How can you pass an array to a function by value?
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
Implement bit Array in C.
What functions are used in dynamic memory allocation in c?
please explain every phase in the "SDLC" in the dotnet.
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
is it possible to create your own header files?
Which of these functions is safer to use : fgets(), gets()? Why?
What is the sizeof () operator?
What is the difference between int main and void main in c?