Click here to Skip to main content
15,915,513 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Question about uninitialized memory. Pin
Joaquín M López Muñoz14-Feb-03 4:16
Joaquín M López Muñoz14-Feb-03 4:16 
GeneralRe: Question about uninitialized memory. Pin
Tim Smith14-Feb-03 7:03
Tim Smith14-Feb-03 7:03 
GeneralRe: Question about uninitialized memory. Pin
George214-Feb-03 17:17
George214-Feb-03 17:17 
GeneralRe: Question about uninitialized memory. Pin
George214-Feb-03 17:16
George214-Feb-03 17:16 
GeneralProblems with HTMLElementEvents2 Pin
Xavyer13-Feb-03 2:23
Xavyer13-Feb-03 2:23 
GeneralRe: Problems with HTMLElementEvents2 Pin
stereo16-Feb-03 5:57
stereo16-Feb-03 5:57 
GeneralRe: Problems with HTMLElementEvents2 Pin
Xavyer16-Feb-03 8:04
Xavyer16-Feb-03 8:04 
GeneralQuestion about allocate of STL. Pin
George213-Feb-03 1:55
George213-Feb-03 1:55 
Hi, everyone!

Here is a sample of the usage of allocate of STL.
When compiling it with VC6.0, some error occur.

I have added the source codes and related error
messages below.

Source:

--------
#include <vector>
#include <algorithm>
#include <iostream>
#include <functional>

using namespace std;

int main()
{
vector<int> a (2, 5);
vector<int> b (2, 7);
int *c = allocate((ptrdiff_t) a.size(), (int*)0 );

transform ( a.begin(), a.end(), b.begin(),
raw_storage_iterator<int*, int> (c), plus<int>() );

copy (&c[0], &c[2], ostream_iterator<int> (cout, " ") );

return 1;
}
--------


Error messages:

--------
C:\Program Files\Microsoft Visual Studio\MyProjects\testRawIterator\testRawIterator.cpp(12) : error C2065: 'allocate' :

undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\testRawIterator\testRawIterator.cpp(12) : error C2440: 'initializing' :

cannot convert from 'int' to 'int *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
--------


How to resolve the trouble?


Thanks in advance,
George

GeneralRe: Question about allocate of STL. Pin
markkuk13-Feb-03 2:24
markkuk13-Feb-03 2:24 
GeneralSinking events... Pin
LukeV12-Feb-03 3:25
LukeV12-Feb-03 3:25 
GeneralRe: Sinking events... Pin
LukeV12-Feb-03 4:37
LukeV12-Feb-03 4:37 
GeneralRe: Sinking events... Pin
LukeV12-Feb-03 11:45
LukeV12-Feb-03 11:45 
GeneralQuestion about front_inserter of STL. Pin
George212-Feb-03 2:56
George212-Feb-03 2:56 
GeneralRe: Question about front_inserter of STL. Pin
Joaquín M López Muñoz12-Feb-03 6:47
Joaquín M López Muñoz12-Feb-03 6:47 
GeneralRe: Question about front_inserter of STL. Pin
George212-Feb-03 13:32
George212-Feb-03 13:32 
GeneralQuestion about reverse_iterator. Pin
George212-Feb-03 2:21
George212-Feb-03 2:21 
GeneralRe: Question about reverse_iterator. Pin
Joaquín M López Muñoz12-Feb-03 2:26
Joaquín M López Muñoz12-Feb-03 2:26 
GeneralRe: Question about reverse_iterator. Pin
George212-Feb-03 2:35
George212-Feb-03 2:35 
GeneralQuestion about iterator of STL. Pin
George212-Feb-03 1:43
George212-Feb-03 1:43 
GeneralRe: Question about iterator of STL. Pin
Joaquín M López Muñoz12-Feb-03 2:07
Joaquín M López Muñoz12-Feb-03 2:07 
GeneralRe: Question about iterator of STL. Pin
George212-Feb-03 2:11
George212-Feb-03 2:11 
GeneralRe: Question about iterator of STL. Pin
Joaquín M López Muñoz12-Feb-03 2:19
Joaquín M López Muñoz12-Feb-03 2:19 
GeneralRe: Question about iterator of STL. Pin
George212-Feb-03 2:22
George212-Feb-03 2:22 
GeneralMFC And STL Pin
super11-Feb-03 3:46
professionalsuper11-Feb-03 3:46 
GeneralRe: MFC And STL Pin
Joaquín M López Muñoz11-Feb-03 7:54
Joaquín M López Muñoz11-Feb-03 7:54 

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.