Click here to Skip to main content
15,914,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: copy files from virtual folders Pin
sieppl1-Sep-04 21:15
sieppl1-Sep-04 21:15 
Generalusing Timer Pin
pnpfriend1-Sep-04 5:49
pnpfriend1-Sep-04 5:49 
GeneralRe: using Timer Pin
David Crow1-Sep-04 7:51
David Crow1-Sep-04 7:51 
GeneralUsing STL with Visual C++ Pin
M_A1-Sep-04 4:42
M_A1-Sep-04 4:42 
GeneralRe: Using STL with Visual C++ Pin
Joaquín M López Muñoz1-Sep-04 8:43
Joaquín M López Muñoz1-Sep-04 8:43 
GeneralRe: Using STL with Visual C++ Pin
Chris Losinger1-Sep-04 10:19
professionalChris Losinger1-Sep-04 10:19 
GeneralRe: Using STL with Visual C++ Pin
Lim Bio Liong1-Sep-04 18:23
Lim Bio Liong1-Sep-04 18:23 
GeneralRe: Using STL with Visual C++ Pin
M_A1-Sep-04 21:32
M_A1-Sep-04 21:32 
Hello again!

This is an extraction from one of my projects and it works perfect on Dev C++, but not on Visual C++ 6.


.................................
#include <iostream>
#include <iomanip>
#include "jumper_info.h"

using std::cout; using std::endl;
using std::cin; using std::ios;

bool compare (const Jumper_info& a, const Jumper_info& b);
std::ostream& operator << (std::ostream& out, std::vector<jumper_info>);

int main ()
{
int count=0;
Jumper_info temp;
vector<jumper_info> theJumpers;
theJumpers.reserve(20);
vector<double> points;

while(cin >> temp) {
calculate_result(temp);
theJumpers.push_back(temp);
}


std::sort(theJumpers.begin(),theJumpers.end(),compare);

int counter=0;
for(vector<jumper_info>::const_iterator i =theJumpers.begin(); i !=theJumpers.end();i++) {
counter++;
cout <<counter <<="" "="" *i;
}

="" return="" 0;
}


this="" file="" alone="" generates="" the="" following:
...........................................................
eader\main_uppg2.cpp(39)="" :="" error="" c2039:="" 'sort'="" is="" not="" a="" member="" of="" 'std'
c:\temp\0901\reader\main_uppg2.cpp(39)="" c2065:="" undeclared="" identifier
c:\temp\0901\reader\main_uppg2.cpp(42)="" c2653:="" 'vector<struct="" jumper_info,class="" std::allocator<struct="" jumper_info=""> >' : is not a class or namespace name
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2065: 'const_iterator' : undeclared identifier
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2146: syntax error : missing ';' before identifier 'i'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2065: 'i' : undeclared identifier
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2440: '=' : cannot convert from 'struct Jumper_info *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2446: '!=' : no conversion from 'struct Jumper_info *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2040: '!=' : 'int' differs in levels of indirection from 'struct Jumper_info *'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2146: syntax error : missing ')' before identifier 'i'
c:\temp\0901\reader\main_uppg2.cpp(42) : warning C4552: '!=' : operator has no effect; expected operator with side-effect
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2059: syntax error : ';'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2059: syntax error : ')'
c:\temp\0901\reader\main_uppg2.cpp(42) : error C2143: syntax error : missing ';' before '{'
c:\temp\0901\reader\main_uppg2.cpp(44) : error C2100: illegal indirection

...............................

I also get problems with getline in the following part.

getline(in,jumper.name,'\n');



Thanks for all the help!
QuestionCan I declare a path with a single &quot;\&quot; Pin
nigma_x1-Sep-04 4:07
nigma_x1-Sep-04 4:07 
AnswerRe: Can I declare a path with a single &quot;\&quot; Pin
David Crow1-Sep-04 4:12
David Crow1-Sep-04 4:12 
GeneralRe: Can I declare a path with a single &quot;\&quot; Pin
Mika Larramo2-Sep-04 12:31
Mika Larramo2-Sep-04 12:31 
AnswerRe: Can I declare a path with a single &quot;\&quot; Pin
V.1-Sep-04 4:23
professionalV.1-Sep-04 4:23 
QuestionHow to call a variable in system() Pin
MrJake1-Sep-04 3:31
MrJake1-Sep-04 3:31 
AnswerRe: How to call a variable in system() Pin
David Crow1-Sep-04 4:16
David Crow1-Sep-04 4:16 
AnswerRe: How to call a variable in system() Pin
Lim Bio Liong1-Sep-04 7:31
Lim Bio Liong1-Sep-04 7:31 
QuestionHow to change Grid lines Color in List Control Pin
Muhammad Azam1-Sep-04 3:03
Muhammad Azam1-Sep-04 3:03 
GeneralList Controls Row Height Pin
Muhammad Azam1-Sep-04 3:00
Muhammad Azam1-Sep-04 3:00 
GeneralCreating user accounts in XP Pin
Phil J Pearson1-Sep-04 2:54
Phil J Pearson1-Sep-04 2:54 
GeneralRe: Creating user accounts in XP Pin
Antony M Kancidrowski1-Sep-04 3:15
Antony M Kancidrowski1-Sep-04 3:15 
GeneralRe: Creating user accounts in XP Pin
Phil J Pearson1-Sep-04 3:43
Phil J Pearson1-Sep-04 3:43 
GeneralRe: Creating user accounts in XP Pin
Phil J Pearson1-Sep-04 5:05
Phil J Pearson1-Sep-04 5:05 
GeneralRe: Creating user accounts in XP Pin
darkbyte1-Sep-04 8:31
darkbyte1-Sep-04 8:31 
GeneralAssert message Pin
Anonymous1-Sep-04 2:54
Anonymous1-Sep-04 2:54 
Generalmemory problem with bitmaps Pin
eNez1-Sep-04 1:50
eNez1-Sep-04 1:50 
GeneralRe: memory problem with bitmaps Pin
David Crow1-Sep-04 4:26
David Crow1-Sep-04 4:26 

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.