January 26th, 2012 09:18 AM
this compiles
#include <utility>
#include <Windows.h>
int main()
{
RECT rc = {0};
std::pair <LONG,LONG> ControlSize;
December 31st, 2011 12:33 PM
You're welcome :).
Also my code made sure it didn't break the command:
EXENAME > echo.txt
To make sure your app doesn't break that command, you need to adapt IsAConsole at the least like:
...
December 31st, 2011 10:33 AM
This is what ~cConsoleInitializer did
~cConsoleInitializer()
{
if( File )
{
INPUT_RECORD InputRecord;
InputRecord.EventType = KEY_EVENT;
December 30th, 2011 02:28 AM
This seems like what you want:
#include <windows.h>
#include <iostream>
#include <cstdio>
bool IsAConsole( HANDLE Handle )
{
DWORD Mode;
return GetConsoleMode( Handle, &Mode ) != 0;...
December 16th, 2011 07:06 PM
To be more elaborate about trying &Class.myfunction from my previous post. The compiler will complain about trying to form a pointer by taking the address of a bound member function.
The correct...
December 16th, 2011 04:15 PM
Visual Studio 2010 c++ compiler:
Gcc 4.7.0:
This is incorrect since he only defined and declared a free standing function pointer, so you can assign any free standing function that...
December 9th, 2011 10:42 AM
I am confused about what you mean, but how about
class A{};
class B : public A{};
int main()
{
A* pA = new B;
B& pB1 = static_cast<B&>(*pA);
}
December 4th, 2011 07:28 AM
This is now possible with the new standard of c++ now called c++11 which was just finalized in August this year. c++11 is still being implemented in compilers. Gcc 4.7 and Clang 3.0 supports this...
November 21st, 2011 09:12 AM
#include <functional>
#include <algorithm>
#include <vector>
#include <string>
#include <locale>
#include <boost/algorithm/string/case_conv.hpp>
using namespace std;
using namespace...
November 14th, 2011 06:39 AM
I am sure you meant
template <class T>
Class1 < Class2 <T>>A problem that has now been fixed in the new c++11 standard. Any compiler that has been updated to conform will compile correctly.
You...
November 8th, 2011 01:57 AM
char n[29];Why not use std::string?
I think you quoted more than what you intended because you didn't fix the unsafe practice of calling delete by hand which can be fixed with raii design at the...
November 8th, 2011 01:34 AM
cout<<"Enter name :";
cin>>n;
cout<<"Enter shares :";
cin>>num;
cout<<"Enter share value :";
cin>>val;
s1[0].setName(n);
November 7th, 2011 10:17 PM
I want to point out the template way to determine the size which adds a little bit of safety as well.
template< typename TYPE, int Size >
size_t GetArrayLength( TYPE (&Array)[Size] )
{ ...
November 7th, 2011 04:37 AM
Why not learn from tutorials as well? Also read faqs. They can provide common pitfalls and how to avoid them. Googling your question first is even better if you can generalize it.
void...
November 6th, 2011 07:08 AM
Actually I was thinking of a user's point of view. I can see how you got confused, but as a programmer I haven't actually looked at windows 8 ... yet ...
So what if metro maybe the next big...
November 2nd, 2011 07:17 PM
class UtilWindow
{
public:
Reshape(int width, int height);
~Reshape();
private:
};You should look at some tutorials about classes and see how they declare a constructor and...
October 31st, 2011 05:30 PM
I wouldn't inherit a shared_ptr since the destructor isn't virtual. Also shared_ptr only destroys the object it contains only after all shared_ptrs destruct, so if a user clicks the exit button, you...
October 31st, 2011 11:16 AM
I disagree. It is to make things easier by mapping one set of contexts to another and not to make things harder in general. I am fine with simplifying tools to make them more flexible and less ridged...
October 30th, 2011 12:17 PM
Well I am glad you revised your words because I really didn't read it that way the first time :). I won't argue that they are more prone to write horrible code, but at least it won't blow up so...
October 30th, 2011 10:42 AM
I disagree. A high level language should make it easier to write code since it abstracts away hardware dependency which abstracts away concepts related to hardware. For example, who aligns machine...
October 24th, 2011 10:22 AM
I agree knowing how things work and why is important. That is why I like computers in the first place :) They are quite complicated.
October 24th, 2011 09:13 AM
This is because of the c++ standard. The only type of polymorphic behavior that goes by its direct effect is class polymorphismThat is because c++ doesn't have another terminology for class...
September 27th, 2011 07:41 AM
example...
class cMainWindow
{
cWindow Window;
cButton SaveButton;
cButton CloseButton;