Search:

Type: Posts; User: Pingoo

Search: Search took 0.00 seconds.

  1. Replies
    11
    Views
    13,010

    I made following changes. #include ...

    I made following changes.


    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>


    void parse_my_string(char**, char *, char *);
    int count_spaces(char*);
  2. Replies
    11
    Views
    13,010

    something like this: #include ...

    something like this:



    #include <stdio.h>
    #include <string.h>

    char **parse_my_string(char [][], char *, char *);

    char parsed_str[5][20];
  3. Replies
    11
    Views
    13,010

    I made the following changes: char...

    I made the following changes:


    char **parse_2D(char parsed_arr[5][20], char *str_to_be_parsed, char ch)
    {
    strcpy(parsed_arr[0], str_to_be_parsed);
    --------
    --------
    return...
  4. Replies
    11
    Views
    13,010

    I tried to allocate char arr_str[5][10] before...

    I tried to allocate char arr_str[5][10] before the function definition. It complied without any errors. But, when I tried to test it in the main, It is giving me error: "error C2664: 'strcpy' :...
  5. Replies
    11
    Views
    13,010

    Function returning array of strings.

    Hi,

    I want to write a function to parse a string, which will return the parsed strings in the array format.
    I just wanted to know how should I declare my function which will return me an array...
  6. Replies
    13
    Views
    3,060

    Thanks for correcting me. It is working fine now....

    Thanks for correcting me. It is working fine now.

    gdb was useful too.
  7. Replies
    13
    Views
    3,060

    After doing the required changes, I am getting...

    After doing the required changes, I am getting following output

    $ gcc -o trim trim_whitespace.c
    $ ./trim This is a test string.
    The value of i is 1
    Trimed string is This
    The value of i is...
  8. Replies
    13
    Views
    3,060

    I am taking cmd line arguments and calling this...

    I am taking cmd line arguments and calling this function to trim the whitespaces.

    int main(int argc, char **argv)
    {
    char str[100];
    int i;

    for(i=1; i<=strlen(str); i++)
    {...
  9. Replies
    13
    Views
    3,060

    Trim whitespaces

    Hi,

    I am trying to write a C program to trim whitespaces before the string. But, it isn't working properly. Following is what I tried

    char *lefttrim(char *str)
    {
    int i=0;...
Results 1 to 9 of 9