Search:

Type: Posts; User: jw232

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,134

    Resizing and moving windows

    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?...
  2. Replies
    1
    Views
    3,516

    POSIX programming in Windows?

    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...
  3. When I tested it on a console app...

    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...
  4. OutputDebugString not working in Visual Studio 2008

    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...
  5. Thread: Linker errors

    by jw232
    Replies
    3
    Views
    2,763

    From what I read, I just have to add another line...

    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...
  6. Thread: Linker errors

    by jw232
    Replies
    3
    Views
    2,763

    Linker errors

    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...
  7. Replies
    4
    Views
    3,272

    Negative array indexes

    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;
    ...
  8. Replies
    8
    Views
    1,331

    The way I did it wasn't mentioned in the article....

    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...
  9. Replies
    8
    Views
    1,331

    Thanks, that worked. I guess it was compiling in...

    Thanks, that worked. I guess it was compiling in Visual Studio because it isn't very standards-conforming?
  10. Replies
    8
    Views
    1,331

    Templates problem

    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]':...
  11. Replies
    7
    Views
    12,603

    Thanks. I still see question marks because my...

    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...
  12. Replies
    7
    Views
    12,603

    Printing Unicode to console

    #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...
  13. Replies
    10
    Views
    2,344

    Storing classes in variables?

    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;
    ...
  14. Thread: Compiling error

    by jw232
    Replies
    1
    Views
    1,117

    Compiling error

    #include <iostream>

    int main() {
    try {
    throw std::exception("test");
    } catch(std::exception& e) {
    std::cerr << e.what() << '\n';
    } catch(...) {
    std::cerr...
  15. Replies
    1
    Views
    2,903

    Casting int to enum problem

    #include <iostream>

    class Foo {
    public:
    enum Color { r, b, g };
    Color c;
    Foo(Color cc) : c(cc) {}
    };

    int main() {
  16. Replies
    1
    Views
    950

    Creating a Windows program

    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...
  17. Replies
    1
    Views
    926

    Strange compiler error

    #include <iostream>

    class foo {
    public:
    foo() { std::cout << "foo"; }
    void bar() { std::cout << "bar"; }
    };

    int main() {
    foo f();
  18. What's the best way to make an expression evaluate as a double?

    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...
  19. Replies
    4
    Views
    1,061

    I see. Thanks for the correction. Is there any...

    I see. Thanks for the correction. Is there any performance difference?
  20. Replies
    4
    Views
    1,061

    What is a better style?

    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)...
  21. Replies
    14
    Views
    2,253

    Please, don't assume the reason I ask. This was a...

    Please, don't assume the reason I ask. This was a challenged posed in a C++ book.
  22. Replies
    14
    Views
    2,253

    Changing a const variable?

    Is it possible to change a const variable without using pointers, subscripts, unions, or casts?
  23. Thread: output question

    by jw232
    Replies
    9
    Views
    1,483

    Have you tried it yourself? G++ in Cygwin gives...

    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...
  24. Thread: output question

    by jw232
    Replies
    9
    Views
    1,483

    I tried a different compiler and I got "2 1" for...

    I tried a different compiler and I got "2 1" for both cases. I guess it was just my compiler.
  25. Thread: output question

    by jw232
    Replies
    9
    Views
    1,483

    output question

    #include <iostream>

    int& test(int& i) {
    ++i;
    return i;
    }

    int main() {
    int i = 0;
    std::cout << test(i) << ' ' << test(i) << '\n';
Results 1 to 25 of 65
Page 1 of 3 1 2 3