Make your F()
function like
#include<iostream>
using namespace std;
vector<int> F() {
vector<int> x;
x.resize(4);
x[1]=1; x[2]=2; x[3]=3;
return x;
}
No need for F1()
.
More Related Contents:
- banker’s algorithm in c++
- What uses are there for “placement new”?
- Has C++ standard changed with respect to the use of indeterminate values and undefined behavior in C++14?
- c++11 Return value optimization or move? [duplicate]
- What are the differences between C-like, constructor, and uniform initialization?
- Sequence-zip function for c++11?
- Why is conversion from string constant to ‘char*’ valid in C but invalid in C++
- What is the worst real-world macros/pre-processor abuse you’ve ever come across?
- Optional Parameters with C++ Macros
- Pretty-print std::tuple
- Why is std::function not equality comparable?
- In which order should floats be added to get the most precise result?
- What is the purpose of using -pedantic in the GCC/G++ compiler?
- Can a bool read/write operation be not atomic on x86? [duplicate]
- What does “ provide, and where is it documented?
- When does OpenGL get finished with pointers in functions?
- How to make a variadic macro for std::cout?
- Is there any reason to use the ‘auto’ keyword in C++03?
- C++ – GetUserName() when process is run as administrator
- clock function in C++ with threads
- How to print pthread_t
- Are class members guaranteed to be contiguous in memory?
- How do you copy/paste from the clipboard in C++?
- CMake Error: “add_subdirectory not given a binary directory”
- Static library debug symbols
- allocating vectors (or vectors of vectors) dynamically
- What are data breakpoints?
- QScrollArea with dynamically changing contents
- opening image file on c++ , PNG , JPEG [closed]
- Is char default-promoted?