Search:

Type: Posts; User: mazo

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    19
    Views
    1,391

    what about type 'long long'? i don't have a...

    what about type 'long long'? i don't have a compiler here, so i cannot check it. But in some compilers (Borland for DOS maybe)
    this type is also available. (my compiler takes even 'long long ......
  2. Thread: c++ array program

    by mazo
    Replies
    2
    Views
    1,302

    Your piece of code is too small.. we don't know...

    Your piece of code is too small.. we don't know what pa[] and qa[] are, maybe they are too small so the index k is out of range (i don't know what relation is between m and size of these arrays)....
  3. Replies
    15
    Views
    11,851

    % and / operators

    Hmm.. for positive integers it's working really, but what if some of given operands is negative? I think that then % operator returns the value, for which this is true: (a/b)*b + (a%b) = a. (maybe I...
  4. Maybe you can study something about basic data...

    Maybe you can study something about basic data structures, like array, heap, binary tree, linked list.. I recommend you to read essays on www.aihorizon.com or maybe you can find something on this...
  5. Replies
    4
    Views
    1,579

    Thanks a lot, Hammer! I have fixed my bugs(like...

    Thanks a lot, Hammer! I have fixed my bugs(like follows down here) and it's working now excellent!




    else if (argc == 2) {
    in.open(argv[1], ios::binary);

    char *filename;
    filename =...
  6. Replies
    4
    Views
    1,579

    xor encryption and streams

    I tried to write a simple XOR encryption program. But it's not working properly. For some files is the output file longer, for some other shorter then it should be. Here is my source code:


    /*
    ...
  7. Thread: Help Newbie

    by mazo
    Replies
    3
    Views
    876

    And maybe you don't need three for statements.....

    And maybe you don't need three for statements.. only some math :)
    the numbers
    z=p^2 + q^2
    x = p^2 - q^2
    y = 2*p*q
    are pythagoric for two positive integers p,q (p > q).
    (you can prove it...
  8. Thread: Soccer

    by mazo
    Replies
    17
    Views
    2,361

    Soccer is good.. in Slovakia are a lot of people...

    Soccer is good.. in Slovakia are a lot of people fans of soccer..
    But hockey is better :) We are the champions :cool:
  9. Thread: Character arrays

    by mazo
    Replies
    7
    Views
    1,201

    It creates array of 10 sizeof(char), so 10 bytes...

    It creates array of 10 sizeof(char), so 10 bytes usually.
    If you want to use '\0'(and you have to, if you want to use that array as string), it contains only 9 useful characters, so if you are...
  10. Thread: DOS vs. Win32

    by mazo
    Replies
    18
    Views
    2,221

    Poll: I dont know why it is here.. but I think DOS has...

    I dont know why it is here.. but I think DOS has only one big disadvantage: I cannot allocate more then 600k of memory..(borland c++ 3.1)
    But with djgpp and linux compilers (gcc, ..) maybe all...
  11. Replies
    15
    Views
    2,544

    I dont know what that previous algorithm is...

    I dont know what that previous algorithm is doing.. but you can use some fast XOR encryption algorithm, few of them you have here:...
  12. Thread: File I/0

    by mazo
    Replies
    1
    Views
    724

    Hmm.. I think that code which is using CDROM...

    Hmm.. I think that code which is using CDROM isn't for newbies..
    structs like cdtype or what you are using are too complicated for me :) (maybe I'm also a newbie..)

    I think you could write some...
  13. Thread: Header Files

    by mazo
    Replies
    6
    Views
    755

    Ok. I have created some .h file, it contains...

    Ok. I have created some .h file, it contains declarations. But where can I put definitions? They must be in some .cpp file, I think. For example function bodies will be in that .cpp. And how can I...
  14. Thread: C++ Question

    by mazo
    Replies
    4
    Views
    1,011

    A loop.. so: int menu() { int x; ...

    A loop.. so:



    int menu()
    {
    int x;
    cout << "What do you want?";
    cout << "1 - exit\n" << "2 - continue"<< endl;
    cin >> x;
  15. Replies
    12
    Views
    944

    It seems good, using ' '(space) instead of...

    It seems good, using ' '(space) instead of system("cls");.

    Maybe it will be better to use one switch instead of four if statements, it will be much more readable..
    (and also shorter :)
  16. Thread: Flowchart

    by mazo
    Replies
    4
    Views
    2,349

    Sorry, but I really don't know what is...

    Sorry, but I really don't know what is flowchart(I'm from Slovakia, so nothing to wonder..)
    And what is 'using namespace std;'? My compiler doesn't know how to compile it :) I guess it's something...
  17. Thread: color cout..

    by mazo
    Replies
    4
    Views
    3,015

    Poll: I think you have some mistakes in your code: **...

    I think you have some mistakes in your code:
    ** #include <conio.c>
    What is conio.c ??

    And here in your code you don't have a semicolon:

    ** cout << "This will be blue"

    And also on Borland...
  18. Replies
    14
    Views
    1,553

    There are many ways to make a pause before...

    There are many ways to make a pause before exiting a program.
    You can include <conio.h> and then use
    while (!kbhit()); or <stdio.h> and getchar();
    In DOS you can use sleep(int...
  19. Thread: try my game

    by mazo
    Replies
    10
    Views
    1,039

    So, it's not bad. if you want, I can post here my...

    So, it's not bad. if you want, I can post here my own RPG game. It's a bit different than yours, and without help hardly playable ;)
    Because I'm used to play my realtime RPG (maybe its turn-based,...
  20. Replies
    4
    Views
    971

    I'm not a guru, I have to learn really a lot :) ,...

    I'm not a guru, I have to learn really a lot :) , but I think it's about basic concept. If you are creating a big program, you should choose between some basic concepts: object programming, modular...
  21. Replies
    1
    Views
    1,271

    scanf("%d", &temp_s.reorderLevel); ...

    scanf("%d", &temp_s.reorderLevel);
    if(temp_s.reorderLevel != NULL)
    (*new_s).reorderLevel = temp_s.reorderLevel;

    What is temp%s.reorderLevel?
    If it's a pointer, then the scanf won't work(you...
  22. Thread: Linking error....

    by mazo
    Replies
    3
    Views
    699

    Of course there is another way, it depends on...

    Of course there is another way, it depends on your system, for example which compiler and IDE you are using.
    In Linux with gcc you can compile source in *.cpp to object *.o files and then compile...
  23. Thread: Linking error....

    by mazo
    Replies
    3
    Views
    699

    You include building.h in your main, but I think...

    You include building.h in your main, but I think you don't include building.cpp so functions defined there isn't available in main.cpp, you have only prototypes..
  24. Replies
    4
    Views
    5,700

    I have seen some nice one-line functions for...

    I have seen some nice one-line functions for toggling Caps Lock on/off, maybe here: http://www.cprogramming.com/source/caps.zip
  25. Thread: debugging problem

    by mazo
    Replies
    3
    Views
    995

    Problem also can be in some pointers, e.g. you...

    Problem also can be in some pointers, e.g. you use index n in n-element array which is indexed from 0 to n-1. This will give pretty amount of different output, depending on nearly everything..
    I...
Results 1 to 25 of 29
Page 1 of 2 1 2