Skip to content
Snippets Groups Projects
Commit 16231f5f authored by Måns Fredriksson Franzén's avatar Måns Fredriksson Franzén
Browse files

Delete part3.cpp

parent d7f708a0
No related branches found
No related tags found
No related merge requests found
#include <locale.h>
#include <string>
#include <iostream>
#include <time.h>
using namespace std;
float foo(string str);
void baz(float num);
i
int main () {
setlocale(LC_NUMERIC, "sv_SE.UTF8");
setlocale(LC_ALL, "sve_SE.UTF8");
string number("1.2345");
string date("Fri Jul 5 05:04:02 2019");
float svNumber = foo(number);
baz(svNumber);
return 0;
}
float foo(string str){
locale::global(locale("en_US.UTF8"));
return stof(str);
}
void baz(float num){
locale::global(locale("sv_SE.UTF8"));
cout.imbue(locale());
cout << num << endl;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment