Search:

Type: Posts; User: learninC

Search: Search took 0.04 seconds.

  1. Replies
    24
    Views
    2,906

    Hi, I was just passing by and was looking at the...

    Hi, I was just passing by and was looking at the above section of code. Was wondering if you last line of code for returning the value of string compare works. Maybe you should try,

    ...
  2. Replies
    3
    Views
    2,248

    void InsertCharacter(Head *head, char *_char) {...

    void InsertCharacter(Head *head, char *_char)
    {

    String *current;

    /* some function */

    /* I try to copy a character by character into the list */
    while ((_char = getchar()) != '\0')
    {
  3. Replies
    3
    Views
    1,925

    Thx hk_mp5kpdw! I tried assigning another char...

    Thx hk_mp5kpdw! I tried assigning another char pointer to temp, and took into account of the NULL character, now it works perfectly. Thx again!

    Thx Bella_Rosa for the reply, will try your method...
  4. Replies
    3
    Views
    1,925

    Problem with my string reverse code

    Hi all, I was just playing around with strings, and I tried doing a string reverse using pointers, however, it did not turn out as I wanted. I tried using arrays and it works, but I cant do the same...
  5. Replies
    3
    Views
    3,451

    Ok, I got it, thanks guys!

    Ok, I got it, thanks guys!
  6. Replies
    3
    Views
    3,451

    problem with fgets

    Hi all, can anybody help me solve the problem below? If I enter a string with a string length of more than 10 for inputString, the next fgets will just take what is stored in the buffer. I searched...
  7. Replies
    13
    Views
    3,928

    Sorry I am still a bit confused. Please bear with...

    Sorry I am still a bit confused. Please bear with me, as I'm quite new to structures and dates. Given the following structure:

    #include <time.h>

    struct sb
    {
    int id;
    struct tm date;...
  8. Replies
    13
    Views
    3,928

    I would like to ask if it so happens that the...

    I would like to ask if it so happens that the structure contains a date. How do you strtok it? For example:

    #include <time.h>

    struct sb
    {
    int id;
    struct tm date;
    int count;
    char...
  9. Replies
    3
    Views
    3,228

    To eliminate the problem, either u use function...

    To eliminate the problem, either u use function prototypes declaration, or you arrange your function wall_collision before the function movement, as function should be declared before they are used. ...
  10. Replies
    12
    Views
    10,025

    Oh thanks! Sorry for not reading the FAQs. Will...

    Oh thanks! Sorry for not reading the FAQs. Will keep that in mind in the future.
  11. Replies
    12
    Views
    10,025

    print problem while using fgets()

    Hi all, I'm still new to C and would like to ask the following questions. When I use fgets(), does it also reads the '\n' character? What should I do if I would like to print in the following manner....
  12. Replies
    6
    Views
    1,169

    BookListType* bookList = NULL; BookType* example...

    BookListType* bookList = NULL;
    BookType* example = malloc(sizeof(BookType));
    bookList->head = example;
    bookList->head->id = 5;
    I have read throught link list, but I was wondering how can one...
  13. Replies
    8
    Views
    2,625

    Cool! hk_mp5kpdw thank you so much. I have gain...

    Cool! hk_mp5kpdw thank you so much. I have gain more knowledge on C programming now =). Silly me, din use the strcpy function
  14. Replies
    8
    Views
    2,625

    oh thanks!!! Quantum1024, your hint has just woke...

    oh thanks!!! Quantum1024, your hint has just woke me up. I've managed to solved the problem by initialising store. Thanks for all yr help guys, and thanks InvariantLoop
  15. Replies
    8
    Views
    2,625

    Thx Quantum1024. I was also thinking about the...

    Thx Quantum1024. I was also thinking about the same problem, but how do i initialise it? Cos I want to start of with an empty array.
  16. Replies
    8
    Views
    2,625

    Its not a complete program, you have to include...

    Its not a complete program, you have to include the header files, <stdio.h>, <ctype.h> and <string.h>. Also convertString is function i wrote, but it doesnt not have any effect on the main code, so I...
  17. Replies
    8
    Views
    2,625

    Funny characters being printed

    Hi all! What i'm trying to do is to store the longest string being input into the program and print it out later. However when i print the longest string, it has some wierd characters at the back....
  18. Replies
    8
    Views
    5,272

    Thanks a lot Quantum1024! It works perfectly....

    Thanks a lot Quantum1024! It works perfectly. Could I know why the alogorithm is done in that manner? I'm a bit confused about having a do while loop there. Thanks a lot cos I wanna learn more. =)
  19. Replies
    8
    Views
    5,272

    Yeap thx! I know that i need to check for more...

    Yeap thx! I know that i need to check for more than 1 space in a row, but how do I implement it? I've been trying, but seem not to be able to code it without getting any errors.
  20. Replies
    8
    Views
    5,272

    Eliminating extra spaces between words

    Hi all, I'm quite new to C programming, so forgive me if I've made silly mistakes. I'm tryin to write a program to remove the extra spaces between words.

    For example:


    Input: C Programming ...
Results 1 to 20 of 21