Hello
I am working on a project where code optimization plays a
vital role to get the required performance.
I would like to know is there any possible to reinitializatio n an
array of big size to zero with a single statement.
For example
main()
{
int i =0;
char A[30];
while(condition )
{
//Start
for( i = 0; i < 30; i++)
{
A[i] = 0;
}
//End
for(i = 0; i < 30; i++)
{
printf(" enter a value in the index %d:\n",i);
scanf("%d", &A[i]);
}
/*followed by few other statements*/
} //End of while
}
from the above code I want to remove the for inbetween //start and //
End and replace with a single statement(which should not be a
function) which will assign A contents to zero. Or is there any other
approach that will reduce the time complexity than this.
waiting for reply
Raghu
I am working on a project where code optimization plays a
vital role to get the required performance.
I would like to know is there any possible to reinitializatio n an
array of big size to zero with a single statement.
For example
main()
{
int i =0;
char A[30];
while(condition )
{
//Start
for( i = 0; i < 30; i++)
{
A[i] = 0;
}
//End
for(i = 0; i < 30; i++)
{
printf(" enter a value in the index %d:\n",i);
scanf("%d", &A[i]);
}
/*followed by few other statements*/
} //End of while
}
from the above code I want to remove the for inbetween //start and //
End and replace with a single statement(which should not be a
function) which will assign A contents to zero. Or is there any other
approach that will reduce the time complexity than this.
waiting for reply
Raghu
Comment