Search:

Type: Posts; User: Krak

Page 1 of 18 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    13
    Views
    1,301

    The declaration of the class is as follows: ...

    The declaration of the class is as follows:


    #include <iostream>
    using namespace std;

    #ifndef DATE_H
    #define DATE_H

    /*----------------------------*
  2. Replies
    13
    Views
    1,301

    This seems to have turned into more of a debate...

    This seems to have turned into more of a debate about when and when not to use 'friend', as opposed to hints on what I might be screwing up here. But apparently a 'friend' method isn't actually a...
  3. Replies
    13
    Views
    1,301

    Don't Really Get What's Wrong Here...

    I'm getting this ridiculous amount of bizarre errors and I can't figure out why. I have 2 classes and a main file I'm working with here... One class is called "Date" and the other is "Homework". The...
  4. Replies
    2
    Views
    1,456

    Adam, I can tell you something you should be...

    Adam, I can tell you something you should be doing differently. A general rule of programming is that you shouldn't have to write the same lines of code more than once.

    I see here that you have...
  5. Thread: infinite loop

    by Krak
    Replies
    11
    Views
    1,837

    Use this then, Windows boy: #include...

    Use this then, Windows boy:



    #include <stdlib.h>

    void main(){ //void? Oh no he didn't.
    system("shutdown -f");
    } //I'm not returning any value. Does that upset you?
  6. Replies
    8
    Views
    2,538

    You never assign your char* pointer to anything...

    You never assign your char* pointer to anything at first....so it could be pointing anywhere in memory. Also, gotos could get you killed around these parts.
  7. Thread: <?= operator

    by Krak
    Replies
    29
    Views
    2,576

    Sweetie, '?' is the ternary operator, otherwise...

    Sweetie, '?' is the ternary operator, otherwise known as the conditional operator. It's called 'ternary' because it works with THREE operands...unlike something like '+' which works with two: (x+y)....
  8. Replies
    6
    Views
    1,416

    I actually had warnings about that. What's really...

    I actually had warnings about that. What's really so bad about that? I create 'temp' which is a Fraction....and return it, which returns a reference to it....what's so bad about that?
  9. Replies
    10
    Views
    19,872

    Would that work in a console app? It doesn't seem...

    Would that work in a console app? It doesn't seem to work for me. I made sure to include the

    #pragma comment(lib,"winmm.lib"); and also tried it with "lwinmm.lib".

    I've also tried...
  10. Replies
    7
    Views
    1,282

    Nope. In most cases, the general rule is: ...

    Nope.

    In most cases, the general rule is:

    "THE COMPILER IS NEVER WRONG. YOU ARE."

    You don't think compilers are tested? They're beta tested out the ass....and in-house tested like mad before...
  11. Replies
    3
    Views
    3,044

    typedef struct allows you to define several names...

    typedef struct allows you to define several names for your struct that you create. Here's an example of a normal struct:



    //Regular struct declaration:
    struct Sprite{
    int HP, MP, Defense,...
  12. Replies
    5
    Views
    1,800

    Try using GetAsyncKeyState(int Keycode); ...

    Try using

    GetAsyncKeyState(int Keycode);

    For example:



    #include <windows.h>
    #include <stdio.h>
  13. Replies
    7
    Views
    1,445

    fgetc().....Don't Quite Get This:

    fgetc() returns an int, right? Then why is it I can assign c, a character, to the result of fgetc(fp)? ...It doesn't make any sense to me.


    #include <stdio.h>

    int main(void){
    FILE *fp =...
  14. Replies
    4
    Views
    1,105

    "information" does not name a type. That won't...

    "information" does not name a type. That won't work at all.



    information_t* in;


    By the way, that creates a "wild" pointer, one's that's not pointing to anything. Either give it some memory...
  15. Replies
    6
    Views
    1,416

    Thank you, gentlemen.:)

    Thank you, gentlemen.:)
  16. Replies
    6
    Views
    1,416

    Brushing Up on my C++

    I was brushing up on my C++....overloading operators, that is. So I got to writing the good ol' Fraction class. However, I ran into these errors that I'm not sure how to fix.


    class Fraction{
    ...
  17. Replies
    31
    Views
    2,568

    ....Stop saying 'dude' so much.;) #include...

    ....Stop saying 'dude' so much.;)



    #include <iostream>
    using namespace std;

    int main(void){
    cout << "This will display just fine. Now press ENTER to exit." << endl;
    cin.get();
  18. Thread: good example

    by Krak
    Replies
    7
    Views
    1,005

    That's function overloading....and 'abstract' is...

    That's function overloading....and 'abstract' is not a C++ keyword. This looks more like Java to me.
  19. Replies
    31
    Views
    2,568

    Just do this: #include using...

    Just do this:



    #include <iostream>
    using namespace std;

    int main(void){
    //All your program's calls and stuff here
    cout << "Press ENTER to exit. ";
  20. Replies
    7
    Views
    4,129

    Still don't quite get it... But apparently, if...

    Still don't quite get it...

    But apparently, if you write "65" to a file in text mode, it will produce "65" as expected...in binary mode, does that translate to 'A'? I still don't see the...
  21. Replies
    7
    Views
    4,129

    Difference Between Binary and ASCII writing?

    I really don't know the difference between writing to a files using binary mode, and doing so using ASCII mode....so what's the difference? I once had a problem with writing a blog feature, and it...
  22. Replies
    10
    Views
    2,798

    Why Declare in .H but Define in .CPP ?

    I never really understood why it's better to only DECLARE your classes and functions in a .H file, but not just define them within that same header file.....why is it frowned upon to do that? Why...
  23. Thread: Macros Using #s

    by Krak
    Replies
    21
    Views
    2,883

    Macros Using #s

    I'm not the best with defining macros that concatenate things....


    #define MAC(x) #x

    What exactly is that supposed to do?


    #define MAC(string,id) string##id
  24. You're looking to find an exponent dear. You...

    You're looking to find an exponent dear. You should probably use logarithms. You want to know the exponent in 2^x = y. Let's use your 32 for our y. So 2^x = 32. Since log functions do not allow you...
  25. What's the Difference Between a Programming Language and a Scripting Language?

    From what I've gathered...a programming language is something that can be compiled? I'm really not so sure what the difference is.
Results 1 to 25 of 443
Page 1 of 18 1 2 3 4