Search:

Type: Posts; User: daynorb

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    856

    Best method of string validation?

    In your opinion, what is the best method for validating a user input string.
    For example , to make sure that the user input 7 digits as opposed to letters or a mix of the two.

    Should I use a loop...
  2. Replies
    6
    Views
    3,718

    Thanks for the help! The issue was indeed the...

    Thanks for the help!
    The issue was indeed the linefeed in the gets() value, which was removed using the above method.
  3. Replies
    6
    Views
    3,718

    Are you referring to this? char *newline =...

    Are you referring to this?


    char *newline = strchr(FileString, ' ');
    if ( newline != NULL )
    {
    *newline = '\0';
    ...
  4. Replies
    6
    Views
    3,718

    What might be a way to fix that? I read...

    What might be a way to fix that? I read somewhere about a Replace function that worked like this:

    StudentSearch.Replace("\n\r","");

    but this makes absolutely no sense to me and it didn't work...
  5. Replies
    6
    Views
    3,718

    line 46 " scanf("%s", n); " was just to prevent...

    line 46 " scanf("%s", n); " was just to prevent the program crashing in an endless loop and so I could see the progress of the file pointer.
  6. Replies
    6
    Views
    3,718

    Is this a problem with strcmp?

    Hello again so soon,

    Still writing for a file based database, but now I'm trying to search for key strings to retrieve specific lines of data.

    My problem is that even though I can see that my...
  7. Great thanks to all of you, it's working quite...

    Great thanks to all of you, it's working quite nicely now!
  8. Do you mean something like this? char...

    Do you mean something like this?



    char AddStudent()
    {
    FILE *fptr;


    struct Students
  9. Unfortunately this didn't really solve the...

    Unfortunately this didn't really solve the problem.
    The main issue is that line



    printf("Please enter the first name of the student: ");

    fgets(GNG1106[0].FirstName, SIZE, stdin);
  10. Thanks! I'll give this a try :)

    Thanks! I'll give this a try :)
  11. sorry, quick-fix. In lines 34 and 38 I changed...

    sorry, quick-fix. In lines 34 and 38 I changed fptr to stdin. However, those first two commands are still sticking together and not allowing me to input the First Name.
    Any suggestions?
  12. Can someone please help me with reading strings in structures please?

    Hey there,
    In this component of a program I'm working on, the first four commands in my else statement are sticking together without letting me input the information I'm asking for. I had the same...
  13. Replies
    2
    Views
    1,778

    Thanks for the tip. So I switched to fgets() ...

    Thanks for the tip.
    So I switched to fgets()




    else
    {
    printf("File was opened");
  14. Replies
    2
    Views
    1,778

    Looking for Advice on Strings and Structures

    Hi everyone,

    I'm working on a program for developing files for student marks. My issue is in the else statement. What's happening is that it prints the prompt for the First Name but then prints...
  15. Replies
    7
    Views
    2,254

    You're beautiful and I'm an idiot! Thank you so...

    You're beautiful and I'm an idiot! Thank you so much!

    Braydon
  16. Replies
    7
    Views
    2,254

    This problem has been occurring for a couple...

    This problem has been occurring for a couple days, but only for this program. My other programs still works fine. I am still VERY new to programming, so this may just be problems with syntax, so I...
  17. Replies
    7
    Views
    2,254

    Crashing while using random numbers

    Hey everyone,

    So, I'm in the middle of writing a program in C focusing on the use of random numbers, specifically their applications to dice and guessing games. However, every time I run my...
Results 1 to 17 of 18