Hi, I want to write a C++ program to resize and move windows that are already open. This means I need to get a list of current windows. Can someone point me to relevant documentation on this subject?...
Type: Posts; User: jw232
Hi, I want to write a C++ program to resize and move windows that are already open. This means I need to get a list of current windows. Can someone point me to relevant documentation on this subject?...
Wikipedia says "The UNIX Subsystem is built in to the Enterprise and Ultimate editions of Windows Vista". Does this mean I can compile POSIX programs in Visual Studio on Vista Ultimate? Well, I just...
When I tested it on a console app OutputDebugString() went to output (not immediate). However, I have both windows open so I should see it being printed since it either goes to one or the other (for...
I have a Windows Forms app and print a message using OutputDebugString() whenever a button is pressed. However I don't see any output in the output or immediate window in Visual Studio. Stepping...
From what I read, I just have to add another line to the cpp file. However, I'm still getting linker errors. What am I doing wrong?
#include "GraphEdgeList.h"
#ifdef DEFINEINCPP
template...
I have a header file which contains the class with only function declarations. I then define the function in a separate cpp file. However, I get linker errors when I do this. If I define the function...
I'm trying to translate some pseudocode that starts indexing at -1. Will the following code work like I expect it to?
int main() {
int* a = new int[10];
a = &a[1];
a[-1] = 4;
...
The way I did it wasn't mentioned in the article. Is it one of the other ways of the "several ways to do this"?
I've encountered yet another situation where one compiler will compile and the other...
Thanks, that worked. I guess it was compiling in Visual Studio because it isn't very standards-conforming?
This code compiles and executes fine in Visual Studio. However, g++ gives me the error messages:
t5.cpp: In function `std::ostream& operator<<(std::ostream&, Foo<T>&) [with T =
int]':...
Thanks. I still see question marks because my font doesn't support these characters. Do you know of a font that does? I've tried adding several Japanese fonts that Windows came with to the command...
#include <iostream>
#include <string>
int main() {
std::cout << "こんにちは\n";
std::cin.get();
}
I'm using Visual Studio. I tried running this program. It's supposed to print some...
Is there a way to store a class in a variable, so that for example, code like this would work?
int main() {
T = vector;
T v;
v.push_back(0);
T = list;
T l;
...
#include <iostream>
int main() {
try {
throw std::exception("test");
} catch(std::exception& e) {
std::cerr << e.what() << '\n';
} catch(...) {
std::cerr...
#include <iostream>
class Foo {
public:
enum Color { r, b, g };
Color c;
Foo(Color cc) : c(cc) {}
};
int main() {
I want to make a Windows program that implements something like an alias. For example, it detects if I type "qqq" (three q's in a row) then replaces it with some text so that I can quickly type stuff...
#include <iostream>
class foo {
public:
foo() { std::cout << "foo"; }
void bar() { std::cout << "bar"; }
};
int main() {
foo f();
double x = (WIDTH - 2 * MARGIN) / (MAX - 1) * i;
If I wanted to make the above statement evaluate as a double for the most accuracy where the variables are ints, what's the best way to do that? I...
I see. Thanks for the correction. Is there any performance difference?
I have some functions which perform string transformations. Since they use the original string, but return a copy of the modified string, what is better style?
string transform1(const string& s)...
Please, don't assume the reason I ask. This was a challenged posed in a C++ book.
Is it possible to change a const variable without using pointers, subscripts, unions, or casts?
Have you tried it yourself?
G++ in Cygwin gives me "2 1" for value, "2 2" for reference
VC++ gives me "2 1" both cases
I don't see what you mean, test is called twice, therefore i is incremented...
I tried a different compiler and I got "2 1" for both cases. I guess it was just my compiler.
#include <iostream>
int& test(int& i) {
++i;
return i;
}
int main() {
int i = 0;
std::cout << test(i) << ' ' << test(i) << '\n';