---
title: "C++ Programming Tutorial  12  char Array"
author: "yuanyu5237"
date: "2014-07-03T15:28:36Z"
tags: []
categories: ["编程语言"]
slug: "c-programming-tutorial-12-char-array"
draft: false
lastmod: "2014-07-03T15:28:36Z"
id: 2087974
url: "https://yuandingping.iteye.com/blog/2087974"
---

```
#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;
}
```