How to convert
const uint16 arr[]
to
uint16 arr[]
using c++ ? Please post an example. Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are not bothered about variable name and also you are ok with having different memory for non-const array, then this is the fastest way.
const uint16 arr[] = {1,2,3,4} unint16 arr1[4]; memcpy(arr1,arr,sizeof(arr))