How to Declare byte* ( byte array ) in c++ and how to define as a parameter in function definition?
when I declare like below
Function Declaration:
int Analysis(byte* InputImage,int nHeight,int nWidth);
Getting error : "byte" undefined
How to Declare byte* ( byte array ) in c++ and how to define as a parameter in function definition?
when I declare like below
Function Declaration:
int Analysis(byte* InputImage,int nHeight,int nWidth);
Getting error : "byte" undefined
The C++ type representing a byte is unsigned char (or other sign flavour of char, but if you want it as plain bytes, unsigned is probably what you're after).
However, in modern C++, you shouldn't be using raw arrays. Use std::vector<unsigned char> if your array is runtime-size, or std::array<unsigned char, N> (C++11) if your array is of static size N. You can pass these to functions via (const) references, like this:
int Analysis(std::vector<unsigned char> &InputImage, int nHeight, int nWidth);
If Analysis does not modify the array or its elements, do this instead:
int Analysis(const std::vector<unsigned char> &InputImage, int nHeight, int nWidth);