Search:

Type: Posts; User: lucidrave

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,682

    I like your version of code as it seems the most...

    I like your version of code as it seems the most readable to me... However, there are a few parts of one line of code that I don't quite understand. Could you or someone explain this to me?

    I'm...
  2. Replies
    9
    Views
    1,682

    Thanks. Yeah, I guess I was just overthinking...

    Thanks.

    Yeah, I guess I was just overthinking it a bit with that for-loop for x. I'll modify the code
  3. Replies
    9
    Views
    1,682

    Is there a standard C function to do this?

    I wrote some code today to accept user input for first and last names and then make sure it's formated as such: Randy Collins

    So if the user types RaNDy or rANdY or randy it will format it and...
  4. Replies
    7
    Views
    1,401

    Ok I understand. Thanks for the help on that...

    Ok I understand.

    Thanks for the help on that everyone!
  5. Replies
    7
    Views
    1,401

    Ahh yes! That makes total since... It should have...

    Ahh yes! That makes total since... It should have been obvious i is not the same as firstname[i]

    Although another odd thing... If I put in the name "STEV0000EN"

    at some point firstname will !=...
  6. Replies
    7
    Views
    1,401

    I changed NULL to simply 0 and I didn't get a...

    I changed NULL to simply 0 and I didn't get a warning. That makes sense...

    Though I'm surprised my for loop worked because the condition is keep looping while firstname[i] is not zero, yet i...
  7. Replies
    7
    Views
    1,401

    1 code warning I need help with...

    My program compiles without any errors and runs perfectly, but I am getting a warning that I'm not sure about if you guys can give me some advice it would be most appreciated...

    It says "warning:...
  8. i see that firstname is a string and tolower...

    i see that firstname is a string and tolower won't accept strings, but if i did tolower( firstname[1] ); i figure tolower is only looking at the "R" in a name like "BRYAN"

    if that doesn't work...
  9. i figured since firstname is a string and that is...

    i figured since firstname is a string and that is just an array of characters than it would work. ok, i get that now

    so do i need to do a loop until it reaches NULL /0 in the array and convert...
  10. i'm not sure what the function prototype has to...

    i'm not sure what the function prototype has to do with end of file. i think i'm probably using something i'm not advanced enough to be dealing with yet.

    to me it looks like they are declaring c...
  11. int tolower(int c); ok... now i see it's a...

    int tolower(int c);

    ok... now i see it's a function prototype because of the ; at the end. however, the (int c) part throws me off a little... if (c) is supposed to be a character why don't they...
  12. I posted a bad example... I thought it was C but...

    I posted a bad example... I thought it was C but I guess it was C++

    I am studying C for now at least until I have a firm grasp on how to do everything I want to do.

    A better example is the...
  13. Beginner question about understanding general Syntax

    I've been asking questions on the boards here and have gotten some great help, and I have been learning to program C through a book that is pretty good (so far)

    Anyway, there is going to be a time...
  14. I guess what's confusing me is I thought %[^\n]...

    I guess what's confusing me is I thought %[^\n] was to ignore the new line, but then %*c also ignores the new line. isn't that redundant?

    if %[^\n] doesn't work by itself should I not use it?
    ...
  15. thanks

    ohh ok... so it means ignore any characters after it sees the new line?

    (in this code anyway)
  16. ok, i tried adding this (still doesn't work)

    I figured using a fflush(stdin); would clear the buffer but it doesn't seem to make a difference... I'm clueless how to get this working as expected



    #include <stdio.h>
    #include <string.h>
    ...
  17. Beginner Question: Problem with scanf and strings. Help!

    First off how does scanf know that this: %[^\n] is supposed to be formatted for a String? Shouldn't %s need to be in there? According to the syntax it's not supposed to be.

    Anyway, my real...
  18. thanks!

    thanks everyone! i understand the return statement pretty well now. i even corrected my code so it compiles and runs perfectly fine.



    #include <stdio.h>

    int AddNumbers( void );


    int...
  19. Beginner question about the Return statement

    Before I continue on with my lessons in C, I want to make sure I understand the use of the Return statement within my own functions. From what I understand, when the program encounters the Return...
  20. Replies
    2
    Views
    1,507

    Beginner Question about Pointers in C

    I'm reading through a great book on C but it hasn't done a great job making pointers easy to understand. What I'm having trouble with is not the concept of pointers (although I'm still not sure yet...
  21. Replies
    10
    Views
    1,006

    yeah, the next chapter in the book i'm reading...

    yeah, the next chapter in the book i'm reading talks about pointers and parameters... i haven't quite got there yet. i'm trying to master the different types of loops and understand when it is best...
  22. Replies
    10
    Views
    1,006

    Yeah! It works now! Thanks for the info guys,...

    Yeah! It works now! Thanks for the info guys, bithub's your tip got it working. But tabstop reminded me that for only works when a statement is true.


    There are currently 5 marbles in the cup!...
  23. Replies
    10
    Views
    1,006

    I even simplified the code as much as I could (no...

    I even simplified the code as much as I could (no function calls) and it only works if the value is 10... anything lower or higher doesn't work. Is my logic flawed here? Please help



    #include...
  24. Replies
    10
    Views
    1,006

    well

    there is no value in there because i'm just calling a function... if its under 10 then i call the function UnderTen();
  25. Replies
    10
    Views
    1,006

    Not sure why this doesn't work...

    Basically I'm trying to make this program so if you change the value of cupOfMarbles it will count up and print 5...6...7...8...9...10 and then stop (in this example) or if it is over 10 it will...
Results 1 to 25 of 28
Page 1 of 2 1 2