Search:

Type: Posts; User: Amberlampz

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    19
    Views
    9,456

    float grades[10] You're telling the system to...

    float grades[10]

    You're telling the system to create an array of 10 floats containing indexes 0 through 9.


    for ( i = 1; i <= 10; ++i )

    And you're now telling the system to iterate from the...
  2. Aye, I think I got reverse-confused :P. Thanks...

    Aye, I think I got reverse-confused :P. Thanks for pointing out my error. Still, I would probably avoid having both floats and doubles(just for less confusion's sake) unless there's a convincing...
  3. You're printing out doubles as floats. edit:...

    You're printing out doubles as floats.

    edit: grumpy corrected error
  4. Read about how to write a main function and while...

    Read about how to write a main function and while loops.
  5. Replies
    6
    Views
    1,184

    Considering you're not returning anything (and...

    Considering you're not returning anything (and you're using void main :(), it should be getting garbage values/runtime error/etc. I don't know about your compiler(s), but it may just be "correcting"...
  6. Replies
    13
    Views
    1,733

    Make sure you're completely clear about your...

    Make sure you're completely clear about your instructions (considering an assignment like this does not seem reasonable for any class in C). I would think it easier to "pass two dimensions" if you...
  7. Replies
    6
    Views
    22,669

    This is wrong: for(i=0;i

    This is wrong:


    for(i=0;i<5;i++)
    {
    for(j=0;j<5;j++)
    if(a[i]==a[j])
    {
    freq++;
    }
  8. Replies
    1
    Views
    729

    C File I/O Tutorial - Cprogramming.com...

    C File I/O Tutorial - Cprogramming.com

    Read this. You're opening the file in write mode in both instances.
  9. Replies
    11
    Views
    3,918

    In addition to what's being mentioned, you don't...

    In addition to what's being mentioned, you don't need math.h and you should get rid of the elseif() and just change it to a single if() statement.
  10. Replies
    3
    Views
    1,069

    Look at line 27.

    Look at line 27.
  11. Thread: C Homework

    by Amberlampz
    Replies
    29
    Views
    2,177

    Try to break your code up into individual...

    Try to break your code up into individual functions. Your teacher is really, really not going to like you if everything is plugged into main. It also helps a ton for you, because you can figure out...
  12. Thread: C Homework

    by Amberlampz
    Replies
    29
    Views
    2,177

    If you've taken two courses in Java I don't see...

    If you've taken two courses in Java I don't see how this could be so difficult. You've covered far more extensive and difficult topics than what this asks of you. The thing that might be a little...
  13. Thread: C Homework

    by Amberlampz
    Replies
    29
    Views
    2,177

    C, C++ Programming Tutorials - Cprogramming.com...

    C, C++ Programming Tutorials - Cprogramming.com

    Start reading, I guess. You've got a long way to go syntactically if you don't know how to input values from the keyboard.

    As far as mode...
  14. Replies
    19
    Views
    1,741

    Don't use gets() ever. FAQ > Why gets() is bad...

    Don't use gets() ever.

    FAQ > Why gets() is bad / Buffer Overflows - Cprogramming.com

    Please read this. If you teacher said it's okay then you should try to get a new teacher.
  15. Replies
    28
    Views
    2,270

    His criticism isn't unwarranted. Tater is...

    His criticism isn't unwarranted. Tater is pointing out things in your code that are likely to cause an error and asking you to fix them. It could very well be the case that the problem resides in...
  16. Replies
    28
    Views
    2,270

    Something I read elsewhere: "Define a 10...

    Something I read elsewhere:

    "Define a 10 character buffer and gets() will happily accept the Declaration of Independance as its input."

    It may not be a problem right now, but you're absolutely...
  17. Replies
    39
    Views
    3,012

    I'm curious why a final project is accepted...

    I'm curious why a final project is accepted without modular code or good format, but eh.
  18. I was about to test this myself and see if I...

    I was about to test this myself and see if I could find the error, but it's good to know that you figured it out. I'm not exactly what you'd call a coding guru, but I think it would definitely help...
  19. Replies
    12
    Views
    1,080

    Wow. It's almost hilarious how the simpler...

    Wow. It's almost hilarious how the simpler answers are the hardest to come by. After sleeping on it I deduced that pointers wouldn't really be needed unless I wanted to over-complicate things. ...
  20. Replies
    12
    Views
    1,080

    Noted, and thanks. Given any set of...

    Noted, and thanks.



    Given any set of numbers stored in an array, I compare an array index with the one above it, and if they're equal I increment a counter. These counter values are then...
  21. Replies
    12
    Views
    1,080

    Unfortunately the compiler I'm using is Visual...

    Unfortunately the compiler I'm using is Visual Studio 2010 (and they apparently have no plans to implement it). Is there a workaround, or would you suggest another compiler?



    Not quite. I'm...
  22. Replies
    12
    Views
    1,080

    Thanks for the quick response. Hmmmm. I'm...

    Thanks for the quick response. Hmmmm. I'm afraid I don't quite understand what you mean. I went ahead and changed some things around to make it simpler, though.


    void hurrmode (int array[],...
  23. Replies
    12
    Views
    1,080

    Calculating Mode

    Hello again. I'm looking to calculate a mode in an array, but I've run into a few problems with the syntax. I believe my general methodology would work well, though:

    1. Go through the array
    2....
  24. Hey, look at that; I'm retarded. Program...

    Hey, look at that; I'm retarded.

    Program works. Thanks for the help!
  25. Thanks for the quick response. Okay, so making...

    Thanks for the quick response.

    Okay, so making those changes and adding the printf in the function makes it look like this:


    void hurrdurr (int array[], int size)
    {
    int i, j;
    for (i = 0;...
Results 1 to 25 of 26
Page 1 of 2 1 2