Search:

Type: Posts; User: thungmail

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,264

    but why dont we do another way around like ...

    but why dont we do another way around like


    sem_init(&shared.full, 0, BUFF_SIZE);
    sem_init(&shared.empty, 0, 0);

    I think there is another reason for that but I can not get it...
  2. Replies
    2
    Views
    1,264

    question about semaphores

    typedef struct {
    int buf[BUFF_SIZE]; /* shared var */
    int in; /* buf[in%BUFF_SIZE] is the first empty slot */
    int out; /* buf[out%BUFF_SIZE] is the first full...
  3. Replies
    5
    Views
    1,067

    If I declare char* sche = "Sep 29, 19:34";...

    If I declare


    char* sche = "Sep 29, 19:34";

    Then I can extract each char from "sche" by iterating through "sche.However if I try to use strtok() on schelike following


    char delim[] =...
  4. Replies
    2
    Views
    1,616

    question about strcat() in C

    int main()
    {

    char* date1="Dec 29, 8:30";
    char* date2="Dec 28, 7:30";
    char* year =" 2009";
    strcat(date1,year);
    strcat(date2,year);
    return 0;
    }
  5. Replies
    5
    Views
    1,067

    question about array and pointer

    char* sche = "Sep 29, 19:34";




    char sche[] = "Sep 29, 19:34";


    I would like to ask that 2 lines of codes above are the same meaning in C.What is the meaning of the first code and the...
  6. Replies
    2
    Views
    861

    No iam sorry it is my fault. Thanks

    No iam sorry it is my fault. Thanks
  7. Replies
    2
    Views
    861

    question about the array in C

    char array[] = "Sep 29, 19:34";

    i use strlen() to find the length of array


    red 429 %array.out
    length of array is 3
    red30 %

    The length should be 13. I dont understand why. I need an...
  8. Replies
    4
    Views
    1,361

    Thanks for that. To get each month from above...

    Thanks for that. To get each month from above array,I use array[i].Is there any other ways to get a month from this array. Can i use
    *(arr+i).The compiler gives me an error for this
  9. Replies
    4
    Views
    1,361

    question about the array in C

    I want to declare an array to hold 12 month from Jan to Dec. I am coding like this


    char arr[] ={
    "Jan", "Feb",
    "Mar", "Apr",
    "May", "Jun",
    "Jul", "Aug",
    "Sep",...
  10. Replies
    10
    Views
    51,916

    @slingerland3g: >='a' and

    @slingerland3g: >='a' and <='z' can help me.
    @King Mir : what do you mean pass char as an integer. Could you explain pls
    Thanks all
  11. Replies
    10
    Views
    51,916

    That is what i have just coded #include...

    That is what i have just coded


    #include <stdio.h>
    #include <stdlib.h>
    #include <ctype.h>
    int main ( int argc , char* argv[])
    {
    char* s = "CPROGRAMMING";
    int i;
  12. Replies
    10
    Views
    51,916

    how to check if string contains only alphabet

    If we have a string like "CPROGRAMMING"
    How can we check if this string contains only
    1. Capital letters
    2. No digits
    Thanks
  13. Replies
    10
    Views
    1,333

    Thanks a lot

    Thanks a lot
  14. Replies
    10
    Views
    1,333

    Thanks for your anwsers. I am clear now

    Thanks for your anwsers. I am clear now
  15. Replies
    10
    Views
    1,333

    ok now i am using malloc input = (char*)(...

    ok now i am using malloc


    input = (char*)( malloc(sizeof(char))

    Now the problem is on malloc(sizeof(char) because it does not make sure the bounds of the input unless we have to declare a...
  16. Replies
    10
    Views
    1,333

    4. fgets ( input ,43, stdin ) ; I declare 43...

    4. fgets ( input ,43, stdin ) ;

    I declare 43 bytes because i want to make sure that there is enough for the string from stdin. If i made a small change at line 2


    char input[43];

    It will...
  17. Replies
    10
    Views
    1,333

    question about the fgets()

    There is another question I want to ask about the fgets() in C. Here is my code



    #include <string.h>
    #include <stdio.h>
    1.int main (int argc, char *argv[]){
    2. char* input;
    3. char* arg;...
  18. Replies
    8
    Views
    1,556

    Thanks a lot it is clear now There is another...

    Thanks a lot it is clear now
    There is another question I want to ask about the fgets() in C. Here is my code


    #include <string.h>
    #include <stdio.h>
    1.int main (int argc, char *argv[]){...
  19. Replies
    8
    Views
    1,556

    Thanks for all your answers. For the problem...

    Thanks for all your answers.
    For the problem above, according to laserlight

    I made a small change

    printf("%s\n",*a[1]);
    But still get the error.

    This error still occurs when I try an...
  20. Replies
    8
    Views
    1,556

    thanks for your help but i still feel confused if...

    thanks for your help but i still feel confused if i use


    printf("%s\n",&a[1]);

    it will give me


    ello, World!
  21. Replies
    8
    Views
    1,556

    question about the array type char

    There is code in C


    int main(void)
    {
    char *a = "Hello, World!";
    printf("%s\n",&a[1]);
    return 0;
    }
  22. Replies
    4
    Views
    2,266

    Thanks for your answers all.They are very useful...

    Thanks for your answers all.They are very useful to me know.
    Tuan
  23. Replies
    4
    Views
    2,266

    question about the pthread.

    There are codes about pthread in C


    1.#include <pthread.h>
    2.#include <stdlib.h>
    3.#include <unistd.h>
    4.void *thread_function(void *arg) {
    5. printf("Thread says hi!\n");
    6. ...
  24. question about testing in shell programming

    I have 2 different directories. The first has 2 sub-folders A and B. The second as 2 sub-folders C and D and script named "script".There is a code of "script" to list 2 sub-folders C and D

    ...
  25. question about testing in shell programming

    hi
    How can i list files which are only folders in Unix
    Tuan
Results 1 to 25 of 43
Page 1 of 2 1 2