Search:

Type: Posts; User: tigs

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,053

    >> Concept: Shouldn't classes only change their...

    >> Concept: Shouldn't classes only change their own data?
    In the example I used a global variable just as an example. The real use I'm putting this to is using a class to wrap a complicated tree...
  2. Replies
    5
    Views
    1,053

    References in classes

    Hi,

    Is it possible to have a reference in a class?
    Here is an example:


    class MyClass {
    public:
    MyClass(); // Constructor
    int& y; // Reference (line 16)
  3. Replies
    0
    Views
    6,014

    Convert Microsoft LIB to MingW compatible lib

    Hi,
    I have a lib file made with MS VC++ which I want to try and port to Dev-C++, which uses the MingW compiler. I tried using the reimp MingW utility on it, but it didn't successfully convert it...
  4. Replies
    2
    Views
    1,295

    Command strings

    I kinda need to get it to work with command strings, the easiest way to explain it is that the user types in their own command string which is passed to MCI.
    I get MMSYSTEM device in use errors if I...
  5. Replies
    2
    Views
    1,295

    MCI - multiple samples at once

    I think it is possible, but using MCI command strings, how can you play more than one sample at a time?
    I have searched for quite some time on MSDN and it goes no further than how to play a sample,...
  6. Replies
    5
    Views
    7,207

    Dynamic 2D array of longs: // Malloc returns...

    Dynamic 2D array of longs:


    // Malloc returns a pointer to the beginning of the array you just initialised
    // (long*) is a typecast telling the compiler that malloc is returning a pointer to an...
  7. Replies
    94
    Views
    14,091

    The technology in those multimedia programs is...

    The technology in those multimedia programs is advancing fast, you can do some pretty amazing stuff quickly in them these days. However, at the end of the day, a programming language offers ultimate...
  8. Replies
    12
    Views
    2,184

    If you have a number which won't change...

    If you have a number which won't change throughout the program, why not just use a #define?
    #define diamonds 1
    What is the advantage of const int over a define?
  9. Thread: Simple Question

    by tigs
    Replies
    3
    Views
    985

    int getkey(void) { // Get ASCII code of...

    int getkey(void)
    {
    // Get ASCII code of charactor hit
    int key = getch();
    // ASCII code of hit is 224 - get second getch() to retrieve code of other keys e.g. arrow keys
    if (key == 224) {...
  10. Replies
    94
    Views
    14,091

    Multimedia fusion, the next version of The Games...

    Multimedia fusion, the next version of The Games Factory. It's not bad, but not too flexible. You can write additional objects for it in C++, which I have done, to make life a little easier.
    ...
  11. Thread: Resize an array

    by tigs
    Replies
    3
    Views
    1,569

    My preferred method: long *array = (long*)...

    My preferred method:

    long *array = (long*) malloc(width * height * sizeof(long));

    then to access, use like a one dimensional array
    array[(y * width) + x] = 4;

    When done (MUST do this at end...
  12. Replies
    94
    Views
    14,091

    Huh? If you actually PLAY it, you'll notice it's...

    Huh? If you actually PLAY it, you'll notice it's definitely NOT the TA engine... I didn't make it in C++ anyway, one of those multimedia build-it-all-together programs, so it's a bit crappy and...
  13. Replies
    4
    Views
    2,120

    SetDlgItemInt? You can only SetDialogItemText on...

    SetDlgItemInt? You can only SetDialogItemText on a string, can't you?
    Try an itoa() to turn an integer to a string.
  14. Replies
    94
    Views
    14,091

    Not done in C++, but mleh :) Terminal Orbit...

    Not done in C++, but mleh :)

    Terminal Orbit Real Time Strategy

    Two more pics if you're interested
  15. Replies
    2
    Views
    1,334

    Don't worry, I think I may as well just move on...

    Don't worry, I think I may as well just move on to Win32 API because consoles are ugly and limited...
    So I'll have a good read of that tutorial and ask some more specific questions later if...
  16. Replies
    6
    Views
    2,615

    To work out by brute force: Start looping at...

    To work out by brute force:

    Start looping at the lowest of the two given numbers multiplied by two. Loop every number up to the product of the two numbers.
    In the loop, if you modulus the...
  17. Replies
    2
    Views
    1,334

    Windows console problems

    Hi,

    I've been experimenting a bit with the Windows Console and with a bit of searching I can now set text colour and position the cursor anywhere on the screen to write text, get keyboard input...
  18. Thread: Random Characters

    by tigs
    Replies
    4
    Views
    7,200

    0-9 is ASCII 48-57. a-z is ASCII 97-122....

    0-9 is ASCII 48-57. a-z is ASCII 97-122.
    Generate a random number 0-36, if it's 0-9 convert that to an ASCII 0-9 (add 48). If it's 10 or over add 87. The result should be a char of 0-9 or a-z.
  19. Thread: Contest Problem

    by tigs
    Replies
    2
    Views
    1,003

    Isn't a char -128 to 127? So something with an...

    Isn't a char -128 to 127? So something with an ASCII value of 28 would come out -100. Unsigned char (or byte) is 0-256 I think.
  20. Replies
    58
    Views
    14,268

    There's a text compression contest on the...

    There's a text compression contest on the cprogramming.com main site. Is that still running?
  21. Thread: Defining

    by tigs
    Replies
    7
    Views
    1,605

    But if you did, say: puts("Press any key to...

    But if you did, say:

    puts("Press any key to start");
    would the "start" in that string be replaced by a {?
    Or does the preprocessor not replace inside strings?

    I know it's not a good idea to...
  22. Thread: Set a pixel...

    by tigs
    Replies
    16
    Views
    17,285

    Success!

    Success for setting a pixel in a DOS window!

    I attached to this message 'setpixel.c'

    In a DOS window in mode 13h it draws a little smiley face out of a few set pixels :) compiles in Turbo C.
    ...
  23. Thread: Set a pixel...

    by tigs
    Replies
    16
    Views
    17,285

    Hmm

    Well, I have it, and I'm not entirely sure how to use it. I read the readme's, extracted it all ect. and DJGPP, Turbo C and Dev C++ can't compile anything with #include "allegro.h" in it. It goes...
  24. Thread: Set a pixel...

    by tigs
    Replies
    16
    Views
    17,285

    Blarg

    Thanks... but all I see (with Turbo C) is a single ASCII char in the top left... the other compiler gives syntax error on '*' and 'vga'. What was that code meant to do? Clear the screen?

    I...
  25. Replies
    4
    Views
    2,547

    Alternative

    I find a good way of seeing an ASCII char from its value is

    printf("%c",200);

    where 200 is the ASCII value.

    I tried some hex values and still couldn't find any double-line-to-single-line box...
Results 1 to 25 of 32
Page 1 of 2 1 2