Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect user location #8

Open
scythx opened this issue Jan 4, 2017 · 2 comments
Open

Detect user location #8

scythx opened this issue Jan 4, 2017 · 2 comments

Comments

@scythx
Copy link
Owner

scythx commented Jan 4, 2017

Detect user current location via gps/internet etc.

@richienyhus
Copy link

Haiku has BGeolocation, which uses a proprietary database from Mozilla. There is also a MIT licenced database that could be used.

@CodPro-Sui
Copy link

#include
#include

class User {
public:
User(const std::string& name, double latitude, double longitude)
: name(name), latitude(latitude), longitude(longitude) {}

// Function to remove user's location
void deleteLocation() {
    latitude = 0.0;
    longitude = 0.0;
}

// Function to display user's details
void displayDetails() const {
    std::cout << "Name: " << name << "\nLatitude: " << latitude << "\nLongitude: " << longitude << "\n";
}

private:
std::string name;
double latitude;
double longitude;
};

int main() {
// Create a user and display their details
User user("John Doe", 37.7749, -122.4194);
std::cout << "Before Deletion:\n";
user.displayDetails();

// Delete user's location and display updated details
user.deleteLocation();
std::cout << "\nAfter Deletion:\n";
user.displayDetails();

return 0;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants