F
Frederick Gotham
What's the canonical way to perform an assertion before the definition of any
objects within a function? I've got this at the moment:
void AddFiveEachElement(int *p,size_t const len)
{
int dummy = (assert(p),assert(len),0);
int const *const pover = p + len;
/* Let's pretend we initialise an array here:
int array[4] = {p[0],p[1],p[2],p[3]};
*/
do
{
*p++ = 5;
}while(pover != p);
}
objects within a function? I've got this at the moment:
void AddFiveEachElement(int *p,size_t const len)
{
int dummy = (assert(p),assert(len),0);
int const *const pover = p + len;
/* Let's pretend we initialise an array here:
int array[4] = {p[0],p[1],p[2],p[3]};
*/
do
{
*p++ = 5;
}while(pover != p);
}