Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


whats wrong with this sort?

This topic is 6194 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

#pragma warning ( disable : 4786 )
#include <string>
#include <vector>
#include <iostream>
#include <fstream>

using namespace std;

int x;
int stop;

void main()
	string tmp; 
	vector <string> data;
	ifstream in; 
	while (in.eof() == false)
		std::getline( in, tmp);
	std::sort(data.begin(), data.end);
	for (x=0; x<stop; x++)
		cout<< data[x] << endl;
it takes the variable data and assigns a movie name to each element in the array... like data[1] is terminator 2, data[2] is scary movie etc. i get the errors
error C2039: ''sort'' : is not a member of ''std''
error C2065: ''sort'' : undeclared identifier
when clearly it is a member.. i type std:: and source shows up... what can i do?

Share this post

Link to post
Share on other sites
It might be because you are already using the std namespace. And since you are already using it, it doesn''t recognize it as a scope resolution operator.

Make it work.
Make it fast.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!