Search:

Type: Posts; User: m88g88

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Loop to mark a string as NULL will not work.

    Sorry, I needed to delete this post.
  2. Replies
    21
    Views
    2,748

    This seems like a really good idea for learning...

    This seems like a really good idea for learning programming and you help others in the process. Maybe I'll do that when I have time to learn it properly lol.

    I haven't had time to learn to code...
  3. Replies
    21
    Views
    2,748

    Lol it's okay. Have everything. It's not mine!

    Lol it's okay. Have everything. It's not mine!
  4. Replies
    21
    Views
    2,748

    Thank you, Adam! The help I have received from...

    Thank you, Adam!

    The help I have received from this forum is amazing. Can I ask everyone your motivation for helping people on here? Is it purely out of satisfaction from helping people?
  5. Replies
    21
    Views
    2,748

    Thanks for the extra information! And no, I...

    Thanks for the extra information!

    And no, I haven't changed all my gets to fgets, but it seems to work okay for now, so I will go back to that later (need to look up how fgets works first).

    I...
  6. Replies
    21
    Views
    2,748

    char *ptr; strchr((const char*)asearch,'\n');...

    char *ptr;
    strchr((const char*)asearch,'\n');
    ptr[0] = '\0';



    This does work, but how would you code it so that it does not include 'const char*' (as zac7 said it would happen automatically)....
  7. Replies
    21
    Views
    2,748

    Thank you, this worked!!! :D Now I know more...

    Thank you, this worked!!! :D

    Now I know more about strings, and with all the info provided in this thread, I should be able to complete the program easily.
  8. Replies
    21
    Views
    2,748

    Thank you for your replies. I have have done...

    Thank you for your replies.

    I have have done my best to make these corrections. I have turned the 'asearch' variable into:




    char asearch[15]
  9. Replies
    21
    Views
    2,748

    I have changed the code for searching an array...

    I have changed the code for searching an array to:




    {

    printf("Search for which song??: \n\n");
    ...
  10. Replies
    21
    Views
    2,748

    Thank you, jeffcob! You explained this really...

    Thank you, jeffcob!

    You explained this really well. I have heard of a couple of things (such as strcmp()) and have a book for my module which will explain all this. I was not aware that you would...
  11. Replies
    21
    Views
    2,748

    Program crashes when a loop is meant to begin

    Hello! I have been spending the last 3 days trying to work out why my program crashes after trying to search an array.

    This happens after using the switch to get to 'Manage>Search Track'. It will...
  12. Replies
    5
    Views
    12,698

    strcmp(songs[i], aremove)==0; And I am...

    strcmp(songs[i], aremove)==0;



    And I am told 'incompatible type for argument 1 of 'strcmp'.

    FYI, this is the declaration of 'aremove' (other variables have been deleted to make this shorter).
  13. Replies
    5
    Views
    12,698

    I didn't realise 'remove' is a standard function,...

    I didn't realise 'remove' is a standard function, so have renamed it to 'aremove'. I called it that because once I get this working, I want to try change it so that it can remove a song in the...
  14. Replies
    5
    Views
    12,698

    Comparison between pointer & integer

    Hello!

    I am trying to create a loop that searches a struct array for the value of 'remove' (which is a char).

    Struct:




    typedef struct
  15. Replies
    4
    Views
    1,404

    Thank you! This worked. I am really grateful :D

    Thank you! This worked. I am really grateful :D
  16. Replies
    4
    Views
    1,404

    Thanks, quzah, but what are you referring to with...

    Thanks, quzah, but what are you referring to with 'foo'?

    I have tried entering those 'printf's in different way, but am unable to get them to work. I am very new to programming, so sorry if this...
  17. Replies
    4
    Views
    1,404

    How to display the values of a struct

    I have yet another question!

    How would you display the contents of struct?




    typedef struct
    {
    char track[20];
  18. Finally got the code to work! For some reason...

    Finally got the code to work!

    For some reason I had made a duplicate of a 'for()' and I'm not sure what else was done to fix it. A friend fixed it and he did it too quickly!

    Thank you all for...
  19. Thanks all to your replies. I tried all these,...

    Thanks all to your replies. I tried all these, but could not sort the problem out -probably because I don't have much programming experience and didn't do it properly.

    However, the code on its own...
  20. Thank you, ZuK. The code stopped that problem. It...

    Thank you, ZuK. The code stopped that problem. It now says: syntax error before ']' token.

    I am assuming that that is because you said I would have to define the array of song before I use it,...
  21. 'request for member 'track' in something not a structure or untion

    Trying to scanf to a struct, but when compiling, I am given: 'request for member 'track' in something not a structure or union.

    I have looked around on the internet and one suggestion was to...
  22. Thank you, iMalc!. I'll look into this. We...

    Thank you, iMalc!. I'll look into this. We haven't even learnt about buffering yet, but I have a rough idea, so this will be useful when I've looked into it!
  23. Thank you SO much Salem! This makes more sense...

    Thank you SO much Salem! This makes more sense than the rubbish I wrote lol.
  24. Never used Sprintf before. My program crashes once the sprintf should begin

    The purpose of this code is to let the user enter a name of a song into a string, which can then be buffered and played into a program called 'mplayer'.




    #include <stdio.h>
    #include...
  25. Thank you so much! This works :D I'll experiment...

    Thank you so much! This works :D I'll experiment with it get to understand it, but it helps to understand how to do something when it's done first.

    I am really grateful!!!
Results 1 to 25 of 28
Page 1 of 2 1 2