Search:

Type: Posts; User: darko886

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    4,006

    You just need an ampersand before the variable...

    You just need an ampersand before the variable name in the scanf. When you're scanning integers, or doubles or floats for that matter, you need an & before the variable name in the scanf.
  2. Replies
    14
    Views
    1,547

    Ahhhh!!! You are right!! I was initializing it...

    Ahhhh!!! You are right!! I was initializing it again within the if. I understand now why it wasn't working. Thanks so much!!! I now just have it initialize once at the beginning and then I erased...
  3. Replies
    14
    Views
    1,547

    Ohh okay, so my variables don't exist anymore...

    Ohh okay, so my variables don't exist anymore when the if stops?? Should I just copy everything after the if statements inside each if statement?? Or is there a way to keep the variables going??
    ...
  4. Replies
    14
    Views
    1,547

    If I commented out the whole sections like I do...

    If I commented out the whole sections like I do in the following code, the code functions properly:


    #include <stdio.h>
    #include <time.h>

    // Constants used in the program.
    #define NUM_PEGS 4...
  5. Replies
    14
    Views
    1,547

    Thank you for your help but that is not the...

    Thank you for your help but that is not the problem. They are only allowed to have 4 numbers that they guess, so 0, 1, 2 and 3 would be appropriate. Nothing in the functionality is wrong if I take...
  6. Replies
    14
    Views
    1,547

    One last thing to demonstrate what I mean. If you...

    One last thing to demonstrate what I mean. If you tried to compile that last code I put, then run it, press 1 for single player, then type 4 numbers in from 0 to 5 as a guess, it will just go...
  7. Replies
    14
    Views
    1,547

    This is actually how it was at first, and it...

    This is actually how it was at first, and it didn't work because it said that all of the variables were undeclared, so i initialized some of the variables outside the if statements but then when the...
  8. Replies
    14
    Views
    1,547

    And yes, here is the (looooong) code. I have some...

    And yes, here is the (looooong) code. I have some variables right at the top of main already which i tried to put inside the if statements but it wouldn't let me.




    #include <stdio.h>...
  9. Replies
    14
    Views
    1,547

    Also what I have noticed is that all of my...

    Also what I have noticed is that all of my variables that are used in various functions have to be initialized outside of the if statements, even if the function that uses them is in the same if...
  10. Replies
    14
    Views
    1,547

    Pass variable from if to function

    Hello, I had a class assingment to do to make the game "Mastermind" using my own functions. Now that's done, and I wanted to expand on it to feature a menu and multiplayer. I am fairly new to C...
  11. Replies
    6
    Views
    1,673

    Could anyone give me an example?? I am pretty new...

    Could anyone give me an example?? I am pretty new to C and don't know how I would implement your solutions
  12. Replies
    6
    Views
    1,673

    Thanks for the help, but unfortunately I'm using...

    Thanks for the help, but unfortunately I'm using Windows. Any other way??
  13. Replies
    6
    Views
    1,673

    Read in an online text file

    Hello,

    I was wondering if there was any way that I could read in a file that is stored online. For example, if the file name was golf.txt, and it is on www.example.com/golf.txt. Is there any way I...
  14. Replies
    4
    Views
    1,603

    Open first file in folder

    Hello, I am a total newbie at C programming and I am trying to make a program that renames every file in a directory. I want it to rename every file by deleting the first x amount of characters from...
  15. Replies
    2
    Views
    1,422

    Thank you very much, I was not aware that that is...

    Thank you very much, I was not aware that that is possible, but I will definitely look into that. I got exactly the type of answer I wanted. All you did was point me in the right direction, which is...
  16. Replies
    2
    Views
    1,422

    Delete first two characters

    Hello, I am a total newbie at C programming, and programming in general. I am learning though, and I need help with deleting characters from a file name. What I am trying to do is have a program that...
  17. Replies
    3
    Views
    956

    How did I know it was going to be such an easy...

    How did I know it was going to be such an easy solution =D

    Thank you very much for your help. I just could not see it for the life of me!
  18. Replies
    3
    Views
    956

    Very Simple C Error

    Okay, I am just starting out in C and I am having a problem with this very basic script:


    /* Darko Stamenic
    1/14/2010
    Experiment */

    #include <stdio.h>

    // set known values
Results 1 to 18 of 18