Search:

Type: Posts; User: kryonik

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    3,466

    Actually in the real code I did. I just got a...

    Actually in the real code I did. I just got a little too quick with my keyboard....my bad.
  2. Replies
    11
    Views
    3,466

    Found an easier way to do it.

    Found an easier way to do it.
  3. Replies
    11
    Views
    3,466

    Ive never heard of cast. I'm not using constants...

    Ive never heard of cast. I'm not using constants so I'm not sure how const_cast would help.
  4. Replies
    11
    Views
    3,466

    Convert float to int?

    Can anyone explain how this is done.

    I am importing a couple values from a class and trying to divide them to get a fractional output from two int variables. I currently get a 0 for a and b when...
  5. Replies
    4
    Views
    1,192

    I can put in 80 * 120 and get 9600. If I put...

    I can put in 80 * 120 and get 9600.

    If I put in 222 * 444 I get a -504.

    Thats where the logic fails and I'm not sure why.
  6. Replies
    4
    Views
    1,192

    Calculator Logic

    I've been trying to build a calculator that gets around the limitations of int variables by splitting the number into smaller chunks. I've gotten the add to work successfully but have not been able...
  7. I need some way to seperate either by commas or...

    I need some way to seperate either by commas or seperate into 3 digit pieces after the fact.
  8. how to fill multiple array locations with one input

    I am trying to fill an array with a large number using cin. What I would like to do it take a number like 123,456,789 and put it into someArray[0] = 123, someArray[1] = 456, etc. Can this be done...
  9. Replies
    1
    Views
    2,220

    trying to print a line from a text file

    I've got an apparent logic problem that I can't seem to solve. This program should open a text file and search for a terminal and then print the entire line.

    It does not work as it should and I...
  10. Replies
    8
    Views
    2,291

    jafet, thats some awesome code there ;-) I will...

    jafet, thats some awesome code there ;-) I will be using it to get as an example for some other things I need to learn how to do.

    I think dwks answered the simple question. Doubles can't work...
  11. Replies
    8
    Views
    2,291

    Why does this fail?

    I have tried in vain to debug this. The logic seems to fail around dimes. For most of the values I put in, the logic works fine. However sometimes, there will be a "penny" left in difference and...
  12. Replies
    1
    Views
    1,864

    Structing with grades

    Im working on a program that is supposed to return a class average using a struct. I've found some examples that get me in the right direction, but at the moment, Im not getting very far in...
  13. Replies
    3
    Views
    1,641

    I was working on the same thing. I tried isdigit...

    I was working on the same thing. I tried isdigit and couldnt seem to get the logic quite right. Thanks to your advice, I solved my problem this way:



    #include <stdio.h>
    #include <ctype.h>...
  14. Thread: isdigit woes

    by kryonik
    Replies
    3
    Views
    1,522

    isdigit woes

    Im trying to use isdigit to invoke an error if a string has anything other than a digit in it and having no luck. My old code line will kick out something that starts with a non integer value, ex....
  15. Thread: strcmp

    by kryonik
    Replies
    9
    Views
    6,062

    quzah, I appreciate your help in jogging my...

    quzah,

    I appreciate your help in jogging my thought process. I re-did it using a strcpy and for the moment left the scanf in place. Its not pretty but it works which is all I had to do. Now Im...
  16. Thread: strcmp

    by kryonik
    Replies
    9
    Views
    6,062

    Im going to use fgets on my own. But I'm...

    Im going to use fgets on my own. But I'm supposed to use scanf to get the input. The only thing I can think of at the moment would be to utilize another temp variable to capture the input string...
  17. Thread: strcmp

    by kryonik
    Replies
    9
    Views
    6,062

    My compiler didnt give me any warnings about it. ...

    My compiler didnt give me any warnings about it. It compiled and ran as I posted it. How would I change my code so that I can take an input string from the keyboard until \n is reached and then...
  18. Thread: strcmp

    by kryonik
    Replies
    9
    Views
    6,062

    strcmp

    I'm trying to understand strcmp and not having much luck with it. What Im trying to do is input and compare 7 character strings with strcmp, re-order them accordingly and print out the result. I...
  19. Replies
    9
    Views
    41,317

    I'm going to post the whole section of code. The...

    I'm going to post the whole section of code. The program itself spreads itself over 5 files. The logic I used was to return the players_choice and machine_choice to report.c. The problem seems to...
  20. Replies
    9
    Views
    41,317

    I had this fixed by doing the following: ...

    I had this fixed by doing the following:



    case win:
    ++*win_cnt_ptr;
    //printf("%27sYou win.\n", ""); //old code
    printf("%s%s%s%s%s\n", "You chose ", names[player_choice],
    " and...
  21. Replies
    9
    Views
    41,317

    Print enum value

    I'm trying to figure out how to print an enum variable name verses the enum value. currently my code looks something like this. It prints the numeral 0-2 verses the enum that corresponds with the...
  22. Thanks! It didnt quite fix the problem, but...

    Thanks!

    It didnt quite fix the problem, but it got me going in the right direction, and now the program works like a champ.
  23. More fun with the chinese prime number algorigthm

    I wrote a program that is supposed to take a chinese prime number factoring algorithm and print a list of x prime numbers. The code compiles with no errors and runs. But the program does nothing. ...
  24. Replies
    13
    Views
    2,902

    Thanks for clearing that up!

    Thanks for clearing that up!
  25. Replies
    13
    Views
    2,902

    Im using the book c by dissection and the...

    Im using the book c by dissection and the exercise specifically asked you to write the function isvowel. I do however understand IRL you would do it as you asked.



    Im using visual studio to...
Results 1 to 25 of 28
Page 1 of 2 1 2