|
-
July 13th, 2005, 02:20 PM
#1
help about queue
why this give error:
{
queue<char[4]> list;
char temp[4];
list.push( temp );
temp = list.front();
}
-
July 13th, 2005, 02:27 PM
#2
Re: help about queue
because the type of temp is constant pointer.
-
July 13th, 2005, 03:30 PM
#3
Re: help about queue
even if we take the line
{
temp - list.front();
}there is still error..
the error is in pushing line
{
list.push( temp );
}
-
July 13th, 2005, 03:35 PM
#4
Re: help about queue
Well...simply because you cannot use arrays with the STL containers...simply use 'string' instead...
Code:
#include <queue>
#include <string>
std::queue<std::string> list;
std::string s("Hello");
list.push(s);
std::string t = list.front();
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|