Search:

Type: Posts; User: *pointer

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    13
    Views
    2,848

    Function calls cause overhead, local jumps do...

    Function calls cause overhead, local jumps do not. However, function calls are used most often and people can read them easier; and as quzah said there can be problems with debuging. It's really all...
  2. Replies
    11
    Views
    13,466

    I found two problems, the infinite loop was...

    I found two problems, the infinite loop was caused by the inner most loop. It was using the same counter as the loop before it and one was multiplying while the other was dividing which kept the...
  3. Replies
    13
    Views
    2,848

    Heh, no one would use goto in that situation at...

    Heh, no one would use goto in that situation at all. Notice that the functions do nothing as well, I was trying to save space by making it sort of like a fill in the blank.

    What kind of problems...
  4. Try using a long double.

    Try using a long double.
  5. Though I've never used it and don't know if it's...

    Though I've never used it and don't know if it's compiler specific or not, I believe there is an asm keyword that allows you to put assembler right into your program.


    int main( void ) {
    asm...
  6. Replies
    4
    Views
    1,291

    After you use the value from getch, call...

    After you use the value from getch, call cin.ignore(). That will clear the input stream buffer so that you can read another value.
  7. Replies
    13
    Views
    2,848

    The only people I've heard say never to use goto...

    The only people I've heard say never to use goto are the ones who don't understand it properly, they're just saying to others what was told to them. Yes, goto can cause difficult to follow code, but...
  8. Replies
    15
    Views
    4,897

    >Truthfully, all file read functions eventually...

    >Truthfully, all file read functions eventually call fread().

    Okay, then if I wanted to could I use fread to get all of my data? I thought fread was only for binary files, which is why I've never...
  9. Replies
    10
    Views
    1,299

    I don't know what you people are talking about,...

    I don't know what you people are talking about, quzah always answers your questions in a knowledgeable way. His attitude in doing so doesn't matter as long as you get the information that you ask...
  10. if((isalpha(input)) == TRUE){ /*code to...

    if((isalpha(input)) == TRUE){
    /*code to handle a letter*/
    }else{
    /*code for proper input*/
    }
  11. Thread: Binary Trees

    by *pointer
    Replies
    1
    Views
    911

    This one

    This one
  12. Replies
    11
    Views
    2,882

    Okay, I see what you mean by a division by 0....

    Okay, I see what you mean by a division by 0. What was causing this was the initialization of number_of_students to 0. Also, you never changed this in your code so it stayed at 0 and the final...
  13. Replies
    4
    Views
    1,005

    Bit twiddling hurts portability, unless you plan...

    Bit twiddling hurts portability, unless you plan to use the program only on your own computer it's really best to use the 'one size fits all' functions. Though knowing how to play with bits is nice...
  14. Replies
    1
    Views
    1,481

    That's an easy one, read the input however the...

    That's an easy one, read the input however the user types it in and then parse the string to be all upper or lower case.


    int main(void){
    char pWord[SIZE];

    pWord = cin.getline();...
  15. Replies
    11
    Views
    2,882

    You had a bunch of errors in there, 19 to be...

    You had a bunch of errors in there, 19 to be exact from the start. So I cleaned up the code a bit and fixed the errors, as well as added some much needed formatting ;)

    Look at what you had before...
  16. Replies
    5
    Views
    2,037

    Try this, instead of using a counter you use two...

    Try this, instead of using a counter you use two reader variables, one to read the actual variable and one to test the next one and see if it's valid for the operation. Each time you read the whisker...
  17. Replies
    4
    Views
    1,005

    char c = 'a'; toupper(c); cout

    char c = 'a';
    toupper(c);
    cout<<c<<endl;

    That should print A to the screen, not a. Be sure to include ctype.h
  18. Replies
    11
    Views
    2,882

    Just so you know, enclose all your code on this...

    Just so you know, enclose all your code on this board in the code tags for easier reading. To answer your question, here's the updated code, look for where I put the statement in the while loop. It's...
  19. Replies
    21
    Views
    5,669

    Hmm, I believe my first program that was not a...

    Hmm, I believe my first program that was not a school project was a text based RPG battle engine. I think it was pretty fun, you gained levels, developed new attacks, and there were a bunch of...
  20. Thread: Clearing.

    by *pointer
    Replies
    3
    Views
    1,149

    You mean how do you reset a variable so that the...

    You mean how do you reset a variable so that the next iteration of the loop doesn't use the current value? try this:


    baz = 0;
    for(i = 0; i < FOO; i++){
    for(j = 0; j < BAR; j++){
    ...
  21. Replies
    2
    Views
    1,719

    Do you have anything yet? At least try to do it...

    Do you have anything yet? At least try to do it on your own and if you can't, then ask for help.
  22. Replies
    1
    Views
    1,103

    //Read one character at a time and print it out....

    //Read one character at a time and print it out.
    #include <iostream.h>
    #include <stdio.h> //required for use of getchar()

    int main(void){
    int c;
    cout<<"Enter ctrl+z to quit"<<endl;
    ...
  23. Replies
    5
    Views
    1,186

    The easiest way to pause a program is getchar();...

    The easiest way to pause a program is getchar(); Like so:


    .
    .
    .
    while(1){
    cout<<"Something"<<endl;
    getchar();
    }
  24. Replies
    3
    Views
    1,021

    You can read all you want, but you still won't...

    You can read all you want, but you still won't know jack until you actually try and use it. Believe me when I say that actually writing programs opens the doors of understanding.
  25. Replies
    9
    Views
    1,356

    You want to format a float into currency? ...

    You want to format a float into currency?

    printf("$%.2f", foo);
Results 1 to 25 of 74
Page 1 of 3 1 2 3