I am writing a code that will find items in a csv file. One way is through finding the name and displaying the lat/long that goes with the location and vica-versa. Find=name shows lat/long Numbers=lat/long shows name
If anyone has any ideas, I would like to hear!
City.h
1 2 3 4 5 6 7 8 9 10 11
#pragma once
#include <string>
class City
{
public:
City(std::string words_arg);
std::string& find();
std::string& numbers();
private:
std::string words;
};
City.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include "City.h"
#include <string>
#include <iomanip>
#include "stdafx.h"
#include <sstream>
usingnamespace std;
City::City(std::string words_arg) : words{ words_arg } {}
string& City::find() {//locates city by name
}
string& City::numbers() {//locates city by lat/long
}
I am writing a code that will find items in a csv file.
Perhaps you should first write a function that reads the data from your CSV file and stores the results into a container of some sort. Searching a file is a fairly expensive operation while searching memory is much less expensive.
One way is through finding the name and displaying the lat/long that goes with the location and vica-versa. Find=name shows lat/long Numbers=lat/long shows name