General C++ Programming - February 2014 (Page 26)

by titi
Implementation Running length Smoothing Algorithm
 
Hi, I am new in C++ programming. I use c++ and opencv. The type of image is Mat structure. In matlab, I did this : for i=1:m for j=1:n if(image(i...
[1 reply] : What is tmpText ? A typo perhaps? Should you be using tmpImg ? Ed... (by cire)
by xorkon
Highscore
 
Im making a game in c++, and struggling with how to write out the Highscore. I've got a variable that's counting a player's score, and when it is game over that...
[5 replies] Last: You need to return\pass the variable into the scope that is displaying... (by Computergeek01)
by chacha
JCPP
 
Hi I was trying to implement a library that has the same API than the jdk. Here is the link https://github.com/charb/rpc I paused it for the moment, becau...
[no replies]
Adding External library whit code blocks
 
hi!, first im programming avr in c ! im trying to make a V-USB application so i downloaded library there was vusblib i tryed to all all but it will add them i...
[no replies]
by xkara
Storing multiple arrays based on user input
 
I'm trying to create a function where it allows the user to type in multiple amounts of integers, so if the user wanted to have 3 different storages that hold d...
[3 replies] Last: Can you show the exact code you used? http://ideone.com/4a8PuL (by giblit)
Trouble Processing Code
 
Ok so this is my prompt for my program and I'm having a bit trouble displaying and computing. "Read RoomCapacity from the keyboard
Read PeopleAttending from ...
[4 replies] Last: Ok, Room capacity is 100. and if it is over 100 (eg. 101) I have to ha... (by cppbeginner3)
Homework quesiton on Loops
 
So my program doesn't seem to follow the correct loops when I compare the code I wrote to the code that is actually supposed to happen. We're given a .exe file ...
[1 reply] : Double post. http://www.cplusplus.com/forum/beginner/123110/ (by giblit)
How to allow a class to know about another?
 
Not sure how to setup the includes (if that's how it's done) to allow one class to know about another class. Specifically I want class A to contain an array o...
[2 replies] Last: So your main.cpp should be: A thingA; B thingB; (by ne555)
by Chubby
How to find mode
 
how do you find a mode in array? This is what i got so far i put this after i sort the array for (int index = 0; index < size2; index ++) { //...
[1 reply] : Isn't the mode the number that appears the most in a set of given numb... (by giblit)
flushing question
 
Hello, I am trying to conceptually understand cout flushing. consider the following int func() { cout << "anything"; func1(); // definitions of func1 and f...
[6 replies] Last: Doesn't the cout.flush() tell it to flush? Yes. Why doesn't this ... (by Disch)
Error in reference description of abs
 
I didn't see a place to report errors on this site, so I'm posting my comment here. http://www.cplusplus.com/reference/cmath/abs/ The page says The additional...
[4 replies] Last: Yes. That is, I commented on the <cmath> abs. The <cstdlib> abs is OK. (by sclamage)
Why pure virtual destructor should have body.
 
Why we should provide body to pure virtual destructor? Thanks
[2 replies] Last: If there is no body it would not build properly. You can do class fo... (by ne555)
Problem with templates
 
Dear all, I am having an issue with templates. It is strange because the very very same line of code compiles well if it is inside main, but not if it is in...
[6 replies] Last: > I don't know why you deleted it. I deleted it because after I post... (by JLBorges)
by mora15
Magic Number Revisited
 
i need help writing a modified version of the Magic Number program. For this program, the user is asked to think a number between 1 and 10, and the computer tri...
[4 replies] Last: srand(static_cast<int>(time(0))); this is not necessary you already ... (by giblit)
by S G H
Lambda/Function help
 
I have a collection of objects, and I want to add a collision callback via lambda functions. Basically, I want this to be able to happen: object01.SetC...
[8 replies] Last: @ Cubbi : Thanks! That is interesting to have bookmarked. I just need... (by Computergeek01)
by Plavsa
lexicographical_compare
 
Hello there. I was doing some coding today, and i needed a function to see if 2 words compare lexicographically so after 5 hours of surfin internet i found one ...
[3 replies] Last: std::lexicographical_compare is for when you have a iterator range and... (by Cubbi)
by Chubby
Pointer function:
 
I am trying to make a information to pointer function but the problem is how/what number am i putting in for *a... and can i get that information back to main...
[1 reply] : include <algorithm> // std::swap #include <iterator> // std::e... (by cire)
what does this syntax do?
 
I have seen code recently that looks something like the following... #include <this> #include <that> class MyClass; do some other C++ stuff.... ........
[8 replies] Last: The difference is that you cannot actually call Function3 until A is a... (by LB)
by LB
End iterator invalidation
 
This excellent SO answer explains all the iterator invalidation rules: http://stackoverflow.com/a/6442829/1959975 However it specifically says that it is not cl...
[no replies]
by Drae
Trace Table for an Arrary
 
int marr ={23,67,12,9,33,7}; int track =0; int ans = 2; while(track<7) { marr = marr + 3; if(marr <20) ans = marr / ans; }...
[6 replies] Last: So true. I must apologize cire. (by Drae)
February 2014 Pages: 1... 2425262728... 33
  Archived months: [jan2014] [mar2014]

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