General C++ Programming - September 2011 (Page 8)

by bayou
Unresolved external symbol
 
The following code does not compile in VS 2010 Visual C++. I get the error: error LNK2019: unresolved external symbol "public: __thiscall testTemplate<dou...
[2 replies] Last: Compiler doesn't know type of T. But you are trying to initialize temp... (by tolga gerekci)
Passing Function Pointers
 
I need to use the std::qsort() function to sort variables in a vector of a data member of a class. So this is supposed to exercise the use of extern "C" to pass...
[8 replies] Last: @ CreativeMFS and Duoas: Thank you, that makes perfect sense. Very us... (by aerowenn)
counting no. of new lines in input file
 
Hi everyone, I am trying to count the number new lines, '\n', in an input file that i am reading using getline(). I think that when you use getline(), the ne...
[5 replies] Last: you should have a: read.open("somefile.txt"); or similar, if I am... (by Azagaros)
Input/Output question.
 
This topic has always confused me, and I think it's because I've used its functions without fully understanding how the input/output pointers really work. An...
[5 replies] Last: nevermind, solved. (by azuk040891)
by Ryeman
Insight to template member function specialization
 
Alright...I have been beating a dead horse for about a week now, and I finally found some insight. Sources around the net say that there are only 3 ways to def...
[no replies]
Hint needed to access private functions
 
It's been long since I used this forum, but I am stuck on one part. I have a program that inputs a time in HH::MM AM(PM) and converts from a 12hr time to 24 hr...
[2 replies] Last: Thanks hanst99. (by SFX9901)
Template Function For Pass-By-Reference and Pass-By-Pointer
 
In C++, is it possible to have a single template function that allows both pass-by-reference and pass-by-pointer? For example, I have: template<class T> void ...
[2 replies] Last: Unfortunately the second one won't work with arrays of ints, doubles, ... (by LostProject)
by gizzmo
template specialization
 
Hi, How do I specialize a class template that depends on multiple type definitions template<typename T, class V, class M> class something ? I would like the cl...
[3 replies] Last: The program #include <iostream> using namespace std; template <cla... (by Ralph83)
Stacks
 
I am having a problem with how i should go about this. I have a tube and Im filling it up. Im having an issue figuring out how to write ... If there is room in ...
[5 replies] Last: template <class dType> bool stack<dType>::isEmpty() const{ return (_... (by closed account zwA4jE8b)
Censoring a document (1,2)
 
Im writing a program that takes a datafile Badwords.txt which contains the words to be censored out from a txt file. it will ask the user where the file is t...
[30 replies] Last: I think this an interesting problem to look at, but it is also quite i... (by andywestken)
2d graph for sin values
 
Hi, I have a formula to calculate sin values , after the calculation. I get two array of values. x = {0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60} y = ...
[1 reply] : This is how you can do it even within the console: #include <algorit... (by Ralph83)
AVL insert
 
Hello Guys, I am assigned an AVL tree to write and I'm stuck on the insert!! The function I'm writing is recursive but I get stuck when I do the very first r...
[1 reply] : The "this" pointer in the debug output looks a bit suspicious to me. D... (by Ralph83)
inputing a text file into a 2D array
 
I need help with this function for my program. I'm suppose to load this image from a text file into a 2D array. I'm not sure how to do it withot skipping whites...
[1 reply] : inData.get() won't skip anything. (by hamsterman)
by bilyed
String types in library and header file
 
Hello everybody, I don't if this is a dumb question but I could find any answers. How can I compile a library where there are functions that have string as ...
[4 replies] Last: thank you Athar. (by bilyed)
by bilyed
*** stack smashing detected ***
 
Hi everybody, I have a program that reads the info into a file, check if this is in a mysql table and finally creates a new line or update it. Below it's a sim...
[6 replies] Last: I have solved the problem changing the old c functions and using strin... (by bilyed)
Pointers/Arrays
 
I'm not really sure where I'm going wrong here, I keep going back and forth, I fix one error and get another, etc. The whole concept of pointers and arrays rea...
[4 replies] Last: Ahh, I figured it out. THanks guys! (by tinkydwd123)
Pointer To Deleted Object
 
I'm not sure if I just have some design issues or if I am using C++ incorrectly. Basically, I have an entity manager for all the entities in my game. I also ha...
[3 replies] Last: Thank you for the reply. I decided to use the "standard" shared_ptr an... (by bluehailex)
C++ output question
 
Hi, I am not sure why the output of the double array r is different the two times I call it. In the example below, i have set r = i+j. Then I output it in t...
[2 replies] Last: Got it. Thanks very much. (by duggarm)
by teocl5
Deleting text from file and adding again
 
Hi, I couldnt understand why am i facing this problem. for example. [in my .txt file before delete] a b c d [in my .txt file after deletion] a...
[9 replies] Last: I used the "ternary operator". test ? A : B; It basically means th... (by Galik)
Make Template for working program
 
I made program that ask user to enter number to create an array. Then the array get sorted and the mean, median, and mode gets calculated. My problem is I get e...
[15 replies] Last: He knows the type at compile time. There is no persistence. There is ... (by ne555)
September 2011 Pages: 1... 678910... 31
  Archived months: [aug2011] [oct2011]

This is an archived page. To post a new message, go to the current page.