【发布时间】:2012-09-20 20:15:08
【问题描述】:
#ifndef UNICODE
#define UNICODE
#endif
#include <iostream>
#include <Windows.h>
#include <queue>
using namespace std;
void addSomeContent(queue<TCHAR*> &s)
{
static int counter=0;
TCHAR buffer[30];
wsprintf(buffer,TEXT("foo%d"),counter);
s.push(buffer);
counter++;
if(counter < 10)
addSomeContent(s);
}
int main (void)
{
queue<TCHAR*> strings;
addSomeContent(strings);
while(!strings.empty())
{
wcout<<strings.front()<<endl;
strings.pop();
}
system("pause");
return (0);
}
输出:
foo0
♦
期望:
foo0
foo1
.
.
.
foo9
我哪里错了?
【问题讨论】: