What I'm aiming for, Is that I would like a function template to convert a vector to a type* array for ease of use. Instead of creating multiple functions for the "same" functionality.  With following code(Note function is inside namespace Khan):  // Func.h template &lt;typename T&gt; T* vector_to_array(std::vector&lt;T&gt; vec);  // Func.cpp template &lt;typename T&gt; T* vector_to_array(std::vector&lt;T&gt; vec) {     T* arr = new T[vec.size()];     std::copy(vec.begin(), vec.end(), arr);      return arr;  }  // Inside main function std::vector&lt;int&gt; test_vec = { 0, 2, 3 }; int* test_arr = Khan::vector_to_array(test_vec);   I get the following error:  undefined reference to Khan::vector_to_pointer(std::vector&lt;int, std::allocator&lt;int&gt; &gt;)   I tested different ways, and made a specific function for an int as in the example above excluding the template.  Thus my question is, what is the plausible cause of these errors, and what would be a possible fix?  And to clarify my goal. What my goal is for this, is for the function not dependent on the type, to return a copy of a vector in a C-styled array.  *Edit: Rewrote with complete code, and parts of error was missing.  Solved: As this question is a duplicate, I found my answers in the other post. To summarise what caused this issue, the previous stated error was the cause of declaring the template in a ".cpp" file. And was fixed with declaring and defining the template inside the header file.
Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)
I am teaching how to convert from one base to another base, however, I can't find a way to do something like this:    I know little about Tikz, the only thing I have been able to produce is a simple square with a couple of lines over it, so I don't even know where to start. Any suggestions? I don't mind typing all the numbers, what I want to do is to automatize the process of creating the lines. Story where people inject "books" in the back of their necks? I read this story in middle school or high school and I cannot for the life of me remember the name of it. I think it started off in a small clan of people, there was a young boy who had just come of age and he had some kind of gift that related to the books? Also I think the injecting was illegal, because I vaguely remember the boy encountering an old man who had a bunch of books that he had to keep hidden. There was also a city and he met a girl there that was Special some how. I may just be merging memories but I think at some point the boy and girl went to an underground city?  Does anyone know what I'm talking about? How can i integrate one SFDC org to another SFDC using Rest Api I am trying to integrate one Salesforce org to other org by using Oauth setup, I wanted to use  use consumer key and consumer secret key in my REST class to connect with the org, after connection part completion, I want to access Get(), Put(), Post(), etc. Including the ability to set Oauth and Authorization headers needed for Salesforce Rest API calls.  Actually I'm new in REST implementation so can you please explain me by using code samples. Modifying C string constants? Java Enum definition Any group of index 2 is normal I'm trying to understand the proof that any group of index $2$ is normal.   Let $G$ be a group and $H$ a subgroup of index $2$.  I understand that if $x\in H$ then $xH=H=Hx$ since $H$ is a subgroup. However, I don't understand why if $x\in G\setminus H$ then $xH=G\setminus H.$  I know there are other proofs of this on this site but none of them specifically address this question. Is there a simple way to convert C++ enum to string? So this is a question with which I have been stuck for a while and it all revolves around the concept of volt.  I have posted a LOT of questions on physics forums while trying to understand the concept of volt and potential difference. This is hopefully going to be the last one.  What do you exactly mean when you say that a battery is 2.5 V. I know that it says that the potential difference between the 2 terminals of the battery is 2.5 V  but then what is the potential of the 2 ends of the battery? Is there a unit of potential and not just potential difference?  Also volt = work/charge but how can work/charge express the difference of potentials across the 2 terminals? Where can the last FSTrim be seen as successful or not? (log files) I am making a skydome and I have a texture hooked up with an emission shader for it, however, since the dome is blue it only emits blue light. Is there a way that I can have the whole sky illuminated and have the light reaching the rest of my scene be a different colour? Why do we use $x - y$ rather than $x + y$ in the definition of the convolution? Is it just convention? (If we are thinking of convolutions as weighted averages, for instance against "good kernels," it should make no difference.)  Why $(f * g) (x) = \int f(y) g(x - y) dy$ rather than $(f * g) (x) = \int f(y) g(x + y) dy$?  Edit: I'm finding it really hard to choose a best answer. There are at least three very good ones here. An idiom meaning someone's doing something useless and has no result at the end In my native language, we use an idiom to warn someone that they're doing something which has no result at the end:     Trying to convince him is like squashing water ...   Is there any idiom in English with the same meaning? Any way to change my review of suggested edit? I goofed and rejected a suggested edit, a vote that was actually directed at the previous edit that I was reviewing. As this is unfair to the user who posted the suggested edit in question, is there any way in which to change/cancel my reject? How to prove polynomials with degree $n$ does not form a vector space? This is one of my linear algebra problems:     Prove that polynomials of degree $n$ does not (The professor made these words bold intentionally) form a vector space.   From what I read, the set of polynomials of degree $n$ should be a vector space, because:   There is an "One" and a "Zero" in this set; We can find inverse for addition and multiplication from this set; It follows all the axioms of addition. It follows all the axioms of scalar multiplication.   Then can someone give me some hints to prove it does not form a vector space? How do I show that $x$ is a root of $p(x)$ in $F[x]/\langle p(x)\rangle$? Let $F$ be a field, and $p(x)$ an irreducible polynomial in $F[X]$. Define $K=F[X]/\langle p(x)\rangle$. For every $a\in F$, denote $\bar{a}=\left&lt;p(x)\right&gt;+a$. How do I show that $\bar{x}\in K$ is a root of $p(x)$?. Evaluating $\lim\limits_{n\to\infty} e^{-n} \sum\limits_{k=0}^{n} \frac{n^k}{k!}$ I'm supposed to calculate: $$\lim_{n\to\infty} e^{-n} \sum_{k=0}^{n} \frac{n^k}{k!}$$ By using WolframAlpha, I might guess that the limit is $\frac{1}{2}$, which is a pretty interesting and nice result. I wonder in which ways we may approach it. How to find architecture of my PC and Ubuntu? What is the difference between 'git pull' and 'git fetch'? Homomorphism between compact Hausdorff spaces. For example: $$7x \equiv 1 \pmod{31} $$ In this example, the modular inverse of $7$ with respect to $31$ is $9$. How can we find out that $9$? What are the steps that I need to do? Update If I have a general modulo equation: $$5x + 1 \equiv 2 \pmod{6}$$ What is the fastest way to solve it? My initial thought was: $$5x + 1 \equiv 2 \pmod{6}$$ $$\Leftrightarrow 5x + 1 - 1\equiv 2 - 1 \pmod{6}$$ $$\Leftrightarrow 5x \equiv 1 \pmod{6}$$ Then solve for the inverse of $5$ modulo 6. Is it a right approach? Thanks.