Mega Code Archive
Categories
/
Visual C++ .NET
/
Data Type
Using string for each loop to output chars
#include "stdafx.h" using namespace System; int main() { String^ str1 = "this is a test"; for each (Char ch in str1) { Console::Write(ch); } Console::WriteLine(); }