Beginners - April 2013 (Page 13)

C++ Template Swap Function
 
Hello, I need to make a swap function that swaps two parameters of type T. And following is what I code but something must be wrong. Could anybody better ...
[1 reply] : better code: #include <utility> (That's where that function is decl... (by Cubbi)
C++ Template Errors with different types
 
I need to find all the possible, at least three, errors from the following. template<typename A, typename B, typename C> C myfunction(const A& a,...
[1 reply] : You can have a constant reference to an integer type. Constant referen... (by Daleth)
C++ Memory Leak new Operator
 
I need to identify which objects are destroyed AND if there is any memory leaks on this code. void myfunc() { Photo a(1, 2); ...
[1 reply] : Yes. a is cleaned up automatically. pt leaks.... (by Disch)
Runtime error in hashtable implementation
 
I am getting a strange runtime error when trying to run my hash table program. I have it separated in 3 separate files. I believe I have narrowed down where the...
[2 replies] Last: Did not know which one was the best to post on. Never will happen agai... (by NostawTtam)
"Program that computes a running sum of inputs from the user"
 
This is a practice problem from a book, and I would like some pointers in the right direction. This problem is from a chapter that introduces loops, which I bel...
[8 replies] Last: Ok so.. i just don't understand what you want to do! :P (by eyenrique)
Comparing each letter in two strings
 
So I'm writing a function to compare two strings of letters from a scantron. Example: aaaaaaaAbbbBaccCdaaaaaaaa would be the teachers answer key and aaaaaaaabBB...
[6 replies] Last: I forgot to do TeacherKey == StudentKey - 32 in my code. (by MonkeyVsMonkey)
by dpixel
Animation Timing
 
Hi all. New member here. I've just started learning c++ w/SDL and looking for the correct way of doing animation. My current game loop is set to 60FPS. And I...
[2 replies] Last: Thanks for the quick reply. Very helpful and makes a lot of sense. ... (by dpixel)
Ok I need help with splitting vector slot data.
 
Suppose I have this vector it contains dates example Vector.Dates [slot 1][slot 2] [slot 3] etc... anyways slot 1 contains [ 05282013] slot 2 contains ...
[no replies]
quiz!!
 
I have complied this code, it is suposed to work as an english quiz and my friend is compling the quiz bank. it generates random questions and 15seconds to answ...
[1 reply] : Please edit your post and put the code in the proper tags. And read:... (by Zaita)
Multidimensional arrays - or a simple matrix?
 
Hi! I've got a program to do for class and I'm legitimately stumped on it, so I'd like to ask for some help. The task goes as follows: "Write a functio...
[1 reply] : I think thta you should allocate the matrix dynamically. As for indexe... (by vlad from moscow)
input file into vectors?
 
noob at c++ ---------------------- TL;DR http://www.cplusplus.com/forum/beginner/100291/ --------------------------------------- I think...
[2 replies] Last: { vector<string> appointment1; string line; //if (myfile.is_open()... (by Melicalol)
by Maisah
help in writing 2 programes
 
hi plz could any one solve these 2 C++ problems ? i need the solutions before WED 03/03/13 thnx >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>...
[6 replies] Last: Again, read this post please before posting more: http://www.cplusplus... (by Zaita)
Program Assistance
 
I am working on a program for class and I'm having trouble with it. I am really bad at C++ so I don't really see what I did wrong. The programs opens but just...
[4 replies] Last: No suggestions? (by JDPotts)
by std
why is that happening what's the difference? thanks in advance.
 
Hi everyone. why when passing an object of a specific class as parameter to a friend function of the same object I have access problem whereas when define that ...
[2 replies] Last: Thanks alot Chervil (by std)
length of char
 
hello, I have a question about char. how do you get the length of a char for example: input: hello output: 5 I think this question is already asked ...
[5 replies] Last: The length of a char is always 1 = p the length of a string you can do... (by giblit)
by Ali93
return value
 
Hi :) Why I always got the value return = 0 ?? num is a string number contains binary number begins with the letter "B" assume num="B10111" i got the ret...
[2 replies] Last: Thanks Peter It's work now :) :) (by Ali93)
Won't run past inital selection
 
I can't get this to run past the initial selection. Any ideas? #include <iostream> #include<time.h> using namespace std; //function prototypes ...
[7 replies] Last: Ok - I've got it running now - thanks for your help with that! Now my... (by aflangdon)
Is there an alternative to this switch?
 
Is there an alternative to this switch statement? The switch statement works but I don't like the way it looks in the code. It just seems like there should be a...
[4 replies] Last: Oh. Very nice. That is what I was looking for. I just couldn't visuali... (by BrianDehn)
SDL issue, why does this program freeze when there is 2 bunnies?
 
You may not need to know SDL to see whats going on here, the codes quite simple, in the class the idea is to print an animated frame of the bunny [up/down/lef...
[3 replies] Last: I wondered why I had a zoolander bunny. thanks is see the error of my... (by devonrevenge)
Overloaded class not working
 
I have this code for a homework problem written in its entirety. I used code from my book as a blue print. I cannot get this program to compile. I get an error ...
[7 replies] Last: Yes. Otherwise, there will be some random value in pi that might not n... (by Daleth)
April 2013 Pages: 1... 1112131415... 83
  Archived months: [mar2013] [may2013]

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