Please consider the following code

// dequeue.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <deque>
#include <algorithm>

using namespace std;

struct print
{
    void operator() (int i)
    {
        cout<<"  "<<i;
    }
}myprint;

int _tmain(int argc, _TCHAR* argv[])
{
    deque<int> first;
    deque<int> second(4, 100);
    deque<int> third(second.begin(), second.end());
    deque<int> fourth = third;

    int arr[] = {32, 5, 332, 78, 8};

    deque<int> fifth(arr, arr+(sizeof(arr)/sizeof int));  //Line 28

    cout<<"third : ";
    for_each(third.begin(), third.end(), myprint);
    cout<<endl;

    cout<<"fourth : ";
    for_each(fourth.begin(), fourth.end(), myprint);
    cout<<endl;

    cout<<"fifth : ";
    for_each(fifth.begin(), fifth.end(), myprint);
    cout<<endl;
    return 0;
}


When I compile the above code it gives the following error.

Line 28 : type 'int' unexpected 

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/NFR2cW5nSGZGM0lK.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to