Answers for "c++ get size of unsigned char *"

C++
0

char size length c++

char* a = "ABC";
int length = sizeof(a)/sizeof(char);
Posted by: Guest on July-05-2020
0

c++ to find size of char

#include <iostream>
using namespace std;

int main(){    
    cout << "Size of char: " << sizeof(char) << " byte" << endl;
    cout << "Size of int: " << sizeof(int) << " bytes" << endl;
    cout << "Size of float: " << sizeof(float) << " bytes" << endl;
    cout << "Size of double: " << sizeof(double) << " bytes" << endl;

    return 0;
}
Posted by: Guest on March-19-2022

Browse Popular Code Answers by Language