General C++ Programming - August 2012 (Page 21)

A very strange code
 
Today, when I was going through a code for video coding, I found a very strange code as given below:Please see the strange code in the following URL. ( it is to...
[5 replies] Last: I went the first time, it's like adding elements to a container ¿wha... (by ne555)
Arrange Binary in Order
 
I have this program which generates four unique random numbers from array a . Each random number is compared to the average. If the value is < average repl...
[5 replies] Last: Could you share what happened? Since the code actually worked for me I... (by expor)
by viliml
Can't use threads (1,2,3,4)
 
Hello, I have a problem with multithreading. I thried this minimal code: #include <iostream> #include <thread> using namespace std; int main () { ...
[67 replies] Last: Thanks to everyone who helped me soo much! (by viliml)
GUI using Visual C++ 2010
 
As stated in the title i am trying to make a GUI in visual c++, and i have not found any usefull information about this on google / youtube. I have to make ...
[4 replies] Last: I just started GUI on windows yesterday. I followed these 8 tutorials ... (by dem7w2)
Text Adventure Bug
 
I am making a Text Adventure, and there's an annoying bug that I've come across. Read this code: SHOP1:{} int shop1 = 0; cout << "Shopkeeper: ...
[4 replies] Last: I tried using them, but they weren't working. I expect you did it i... (by Moschops)
extern
 
is there a way to set the external reference as constant while leaving the file that has permission to modify it as non constant or will I just have to use slow...
[2 replies] Last: Thanx (by awsdert)
Specialization of Member function of a Template Class
 
I have following template class defined - <code> template<class T, T invalidVal, int e> Class Cls_Tmp { public: //Constructors and bunch of funcs protected: ...
[4 replies] Last: > Your method does specialization at the 'template class' level based ... (by JLBorges)
vector iterators incompatible
 
Hi, I have problem compiling this code in debug mode code works fine in release mode but I need debug mode and it crash at this->nodes.push_back and debugger s...
[no replies]
Reverse C++ Processing
 
Hi, C++ applications have become more and more complex. Every application maintainer that new to an application would feel very hard to fix bug in short peri...
[no replies]
Destructors of derived class
 
I have the following code, in which is created array of 10 elements (5 objects of class D1 and 5 of class D2). At the end, the program calls base class destruct...
[2 replies] Last: To answer the original question, use a virtual destructor. This is the... (by BlackSheep)
by cdf
how to inherit class
 
i have a header file that i am not allowed to modify, and the problem is that the vars are protected, so i guess i have to inherit that class, how do i do this,...
[1 reply] : I'm sure you'll be fine by just reading this: http://www.cplusplus.com... (by oldcrow)
by cdf
resizing array of pointers problem
 
I am trying to resize an array of pointers to a String class, and an error happens at the last line (getchar is for debugging) so I read a file, each line co...
[3 replies] Last: even when i take that out, i would get an error when closing, but i so... (by cdf)
OpenGL and win32
 
is this a valid combination to create graphics programs? i've been writing OpenGl and win32 programs for awhile now and just want some input on if this is the m...
[1 reply] : I don't see why not. (by closed account o1vk4iN6)
by Miffiq
System() Open file error?
 
I am currently working on my own little version of run. I am trying to make my program open whatever file I input that is in my My Documents folder. I have wi...
[1 reply] : line 23 where it opens the file... its just putting the file into the ... (by Aramil of Elixia)
function sin() and tan() return wrong values
 
so i include math.h inorder to get sin and tan functions so i use them in my code but i figured out that those functions don't return accurate values. i dont r...
[2 replies] Last: thanks (by Yuval Gliz)
ODBC connection problem in a C++ app
 
Hello, I'm having a problem in my application when I'm tring to connect to an ODBC driver using ODBC, I've imported the 4 files below: #include <windows.h...
[no replies]
Error in line "347", but my file only has 242 lines!
 
When I compile my code, it has this single error: "expected declaration before '}' token" supposedly in the line 347, but my file only has to 242 lines! ...
[4 replies] Last: that means its in a header or a cpp that u wrote linked to the header ... (by Aramil of Elixia)
template specialization with template class
 
Hi! I need to specialize a template with a specific template class. This works: template <typename T> class B { }; template <typename T> class A...
[4 replies] Last: I think this is it. Thank you: Imre (by blemidon)
help passing values between functions!!
 
I'm having trouble passing values from the first function to the second without program terminating at calculating, this my my code so far. #include<iostre...
[3 replies] Last: Use the 'code' tags when posting code, it makes it easier to understan... (by oldcrow)
a basic question to cin.ignore()
 
Well, right now, i am trying to understand the cin.ignore() option. So I created following function: #include <iostream> using namespace std; int main()...
[1 reply] : That's not suprising at all! cin.ignnore(n) extracts n characters. wit... (by viliml)
August 2012 Pages: 1... 1920212223... 31
  Archived months: [jul2012] [sep2012]

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