Answers for "length function in c++"

C
1

length of array in cpp

int size = sizeof(arr)/sizeof(arr[0])
Posted by: Guest on May-25-2020
0

length of string in c++

#include <iostream>
using namespace std;
int main() {
    string str = "Viet Nam";
    cout << "String Length = " << str.size();
  	// you can also use str.length()
    return 0;
}
Posted by: Guest on June-05-2021

Code answers related to "length function in c++"

Code answers related to "C"

Browse Popular Code Answers by Language