C99 restrict and function parameters?

S

Sune

Hi,

I'd like to know where to put my restrict qualifier for function
parameters.

I have to files:

test.h and test.c

In test.h I have the declaration:
void test_func( int* p);

and in test.c I have the definition:
void test_func( int* p)
{
*p += 1;
}

For pointer p, do I have to put the restrict qualifier in test.h or
test.c or both?

BRs
/Sune
 
S

santosh

Sune said:
Hi,

I'd like to know where to put my restrict qualifier for function
parameters.

I have to files:

test.h and test.c

In test.h I have the declaration:
void test_func( int* p);

and in test.c I have the definition:
void test_func( int* p)
{
*p += 1;
}

For pointer p, do I have to put the restrict qualifier in test.h or
test.c or both?

Both. In the header it informs the user and in the implementation file
it is obviously needed.
 
O

ollemblomgren

Both. In the header it informs the user and in the implementation file
it is obviously needed.- Dölj citerad text -

- Visa citerad text -

Ok, thanks!
/Sune
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top