Skip to content
Snippets Groups Projects
Commit 10a6fe9a authored by torin's avatar torin
Browse files

Házi feladat: PHP list() I. – a könnyebbik fele

parent 35c73bde
No related branches found
No related tags found
No related merge requests found
...@@ -16,5 +16,26 @@ Name=GCC ...@@ -16,5 +16,26 @@ Name=GCC
Path=gcc Path=gcc
Type=GCC Type=GCC
[Launch]
Launch Configurations=Launch Configuration 0
[Launch][Launch Configuration 0]
Configured Launch Modes=execute
Configured Launchers=nativeAppLauncher
Name=szorg5
Type=Native Application
[Launch][Launch Configuration 0][Data]
Arguments=
Dependencies=@Variant(\x00\x00\x00\t\x00\x00\x00\x00\x01\x00\x00\x00\x0b\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00s\x00z\x00o\x00r\x00g\x005\x00\x00\x00\x0c\x00s\x00z\x00o\x00r\x00g\x005)
Dependency Action=Build
EnvironmentGroup=
Executable=file:///home/junior/projects/szorg5/
External Terminal=konsole --noclose --workdir %workdir -e %exe
Project Target=szorg5,szorg5
Use External Terminal=false
Working Directory=
isExecutable=false
[Project] [Project]
VersionControlSupport=kdevgit VersionControlSupport=kdevgit
...@@ -2,5 +2,6 @@ cmake_minimum_required(VERSION 2.6) ...@@ -2,5 +2,6 @@ cmake_minimum_required(VERSION 2.6)
project(szorg5) project(szorg5)
add_executable(szorg5 main.cpp) add_executable(szorg5 main.cpp)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
install(TARGETS szorg5 RUNTIME DESTINATION bin) install(TARGETS szorg5 RUNTIME DESTINATION bin)
#include <iostream> #include <iostream>
#include <string>
#include <sstream>
template<class T>
void unpack(std::istringstream& s, T& arg)
{
s>>arg;
}
template<class T>
void unpack(std::istringstream&& s, T& arg)
{
s>>arg;
}
template<class T, class ...V>
void unpack(std::istringstream& s, T& arg , V& ...args)
{
s>>arg;
unpack(s,args...);
}
template<class T, class ...V>
void unpack(std::istringstream&& s, T& arg , V& ...args)
{
s>>arg;
unpack(s,args...);
}
template<class ...T>
void unpack(std::string s, T& ...args)
{
unpack(std::istringstream{s},args...);
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
std::cout << "Hello, world!" << std::endl; int a;
double b;
std::string c;
unpack("3 4.5 bla", a, b, c); // a = 3; b = 4.5;
std::cout<<a<<":"<<b<<":"<<c;
return 0; return 0;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment