C++ Programming Tutorial 12 char Array

583 ワード

#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
using namespace std;


int main()
{
	char tuna[6] = {'b', 'u', 'c', 'k', 'y', '\0'};

	cout << tuna << endl;

	char bacon[] = "bacon mmmm good";

	cout << bacon << endl;

	cout << strlen(bacon) << endl;

	cin.get();
	return 0;
}