Pallav singh said:
HI
i have code mixed of C++ & C.
can i pass vector<int > to a function in C.? how it can ve done
Your question cannot be answered unambiguously.
C is not object oriented. You can pass an address of a vector to a C function,
but C will not be able to handle the vector, because it does not know about
the internal structure of it.
You need to provide more information about what the C functions needs.
If the C function needs to modify the size of the vector, than it will be close to impossible.
If the C function needs only access to the elements of the vector
it may be sufficient to pass it a pointer to the first element of the vector
and the size of the vector in another parameter.