Click here to Skip to main content
15,891,567 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Combining multiple standalone applications as an application suite Pin
wxShayan29-May-12 19:02
wxShayan29-May-12 19:02 
GeneralRe: Combining multiple standalone applications as an application suite Pin
Albert Holguin31-May-12 10:17
professionalAlbert Holguin31-May-12 10:17 
QuestionChange Item Text Color - CListCtrl Pin
AmbiguousName29-May-12 1:45
AmbiguousName29-May-12 1:45 
QuestionRe: Change Item Text Color - CListCtrl Pin
CPallini29-May-12 2:40
mveCPallini29-May-12 2:40 
AnswerRe: Change Item Text Color - CListCtrl Pin
AmbiguousName29-May-12 20:16
AmbiguousName29-May-12 20:16 
QuestionRe: Change Item Text Color - CListCtrl Pin
CPallini29-May-12 21:18
mveCPallini29-May-12 21:18 
QuestionRe: Change Item Text Color - CListCtrl Pin
David Crow29-May-12 3:34
David Crow29-May-12 3:34 
Questionproblem with tamplate deque Pin
a1_shay27-May-12 20:07
a1_shay27-May-12 20:07 
i want the user give me number.and i will setup queue with this number of zero.(case e) i get error to copile and i dont know why.

C++
#include <iostream>
#include <list>
#include <deque>
using namespace std;

char option()
{
    char c;
    cout<<"A push valu\n";//done
    cout<<"B pop valu\n";//done
    cout<<"C the first valu in list\n";//done
    cout<<"D is empty\n";//done
    cout<<"E build queue\n";
    cout<<"F print list\n";//done
    cout<<"G print queue\n";
    cout<<"H exit\n";
    cout<<"selecte:";
    scanf("%c",&c);
    return c;
}


void main()
{
   typedef deque<int> j;
   list<int> v;
   list<int>::iterator i;
   int x;
   char c;
   do
    {
      c=option();
      switch(c)
      {
          case 'a':
              cout <<"enter number:";
              cin >> x ;
              v.push_back(x);
              cout << endl;
              flushall();
              break;

          case 'b':
              if(v.empty())
                  cout<<"the list empty\n"<<endl;
              else
              {
                 v.pop_back();
                 cout <<"pop form back done\n"<<endl;
              }
              flushall();
              break;

          case 'c':
              if(v.empty())
                  cout<<"the list empty\n"<<endl;
              else
              {
                  i=v.begin();
                  cout<<*i<<endl;
              }
              printf("\n");
              flushall();
              break;

          case 'd':
              if(v.empty())
                  cout<<"the list empty\n"<<endl;
              else cout <<"there is somting in the list\n"<<endl;
              printf("\n");
              flushall();
              break;

          case 'e':
              int numbers;
              cout<<"how many number you want in queue:";
              cin >> numbers;
              j a(numbers,0);
              printf("\n");
              flushall();
              break;

          case 'f':
              for (i=v.begin(); i != v.end(); ++i)
                  cout << *i << " ";
              cout <<"\n"<< endl;
              flushall();
              break;

          case 'g':
              printf("\n");
              flushall();
              break;

          case 'h':
              cout <<"bye\n"<< endl;
              exit(1);

          default :
              cout <<"no such option\n"<< endl;
              flushall();
              break;
      }
    }while(c!='h');
}

AnswerRe: problem with tamplate deque Pin
«_Superman_»27-May-12 21:33
professional«_Superman_»27-May-12 21:33 
GeneralRe: problem with tamplate deque Pin
CPallini27-May-12 21:39
mveCPallini27-May-12 21:39 
GeneralRe: problem with tamplate deque Pin
a1_shay27-May-12 23:36
a1_shay27-May-12 23:36 
GeneralRe: problem with tamplate deque Pin
CPallini27-May-12 23:51
mveCPallini27-May-12 23:51 
AnswerRe: problem with tamplate deque Pin
CPallini27-May-12 21:38
mveCPallini27-May-12 21:38 
AnswerRe: problem with tamplate deque Pin
Aescleal28-May-12 5:22
Aescleal28-May-12 5:22 
GeneralRe: problem with tamplate deque Pin
a1_shay28-May-12 18:32
a1_shay28-May-12 18:32 
QuestionRe: problem with tamplate deque Pin
David Crow28-May-12 16:58
David Crow28-May-12 16:58 
QuestionHow to integrate cxxTest with Visual Studio IDE Pin
rajKR1227-May-12 19:14
rajKR1227-May-12 19:14 
AnswerRe: How to integrate cxxTest with Visual Studio IDE Pin
Aescleal28-May-12 5:25
Aescleal28-May-12 5:25 
GeneralRe: How to integrate cxxTest with Visual Studio IDE Pin
rajKR125-Jun-12 19:03
rajKR125-Jun-12 19:03 
QuestionCross Platform Development Pin
AmbiguousName27-May-12 0:49
AmbiguousName27-May-12 0:49 
AnswerRe: Cross Platform Development Pin
enhzflep27-May-12 6:16
enhzflep27-May-12 6:16 
AnswerRe: Cross Platform Development Pin
Aescleal28-May-12 5:06
Aescleal28-May-12 5:06 
QuestionApplication Watchdog Pin
Richard Andrew x6426-May-12 16:43
professionalRichard Andrew x6426-May-12 16:43 
AnswerRe: Application Watchdog Pin
«_Superman_»26-May-12 17:30
professional«_Superman_»26-May-12 17:30 
GeneralRe: Application Watchdog Pin
Richard Andrew x6426-May-12 17:42
professionalRichard Andrew x6426-May-12 17:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.