Search:

Type: Posts; User: winbill

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,636

    >char *input; >fgets(input, strlen(input),...

    >char *input;

    >fgets(input, strlen(input), stdin);
    // input is a char pointer,and u should allocate memory for it first

    char input[1024];

    fgets(input,sizeof(input),stdin);
  2. Thread: MySQL and C

    by winbill
    Replies
    2
    Views
    1,473

    make sure you have linked mysql's lib your...

    make sure you have linked mysql's lib
    your makefile should like:

    LIBS = -L/usr/local/mysql/lib -lmysqlclient
    $(CC) -o $(EXECUTABLE) $(OBJS) $(LIBS)
  3. void _ftime( struct _timeb *timeptr ); Header ...

    void _ftime( struct _timeb *timeptr );

    Header
    <sys/types.h> and <sys/timeb.h>
    Compatibility
    Win 95, Win NT

    Parameter

    timeptr
  4. Replies
    2
    Views
    1,841

    The GetDiskFreeSpaceEx function obtains...

    The GetDiskFreeSpaceEx function obtains information about the amount of space available on a disk volume: the total amount of space, the total amount of free space, and the total amount of free space...
  5. Thread: circular shift

    by winbill
    Replies
    2
    Views
    14,358

    >for(i =1; i{ >printf("%d",...

    >for(i =1; i<= 8; i++)
    >{
    >printf("%d", (result & 0x0080) !=0);
    in tc 2.0 sizeof(int) is 2, in gcc it is 4,so replace it with:

    for(i =1; i<= sizeof(result)*8; i++)
    {
    printf("%d", (result &...
  6. Replies
    6
    Views
    1,415

    time_t isn't a structure, it is "long integer",it...

    time_t isn't a structure, it is "long integer",it declared in time.h
    and time() returns the time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.
  7. Replies
    3
    Views
    3,571

    >printf("The Element is %d and its index is...

    >printf("The Element is %d and its index is %d\n", array[i],++i);
    i=-1
    1. ++i, i==0 now.
    2. printf("The Element is %d and its index is %d\n",array[0],0);
    ........
  8. Replies
    9
    Views
    4,329

    a better way to do this : void...

    a better way to do this :

    void do_who_wins(void)
    {
    int Array[]={-2,1,2,-1,0};
    int computer_choice,i;
    char *Message[]={"You win!\n","You loose!\n","You tie.\n","Bug: win table\n"};
    char...
  9. Thread: scanf problem

    by winbill
    Replies
    2
    Views
    2,384

    #include int main(void) { ...

    #include<stdio.h>

    int main(void)
    {
    char Cmd[20],Param[30],Temp[10];

    bzero(Cmd,sizeof(Cmd));
    bzero(Param,sizeof(Param));
    printf("Input command and...
  10. Replies
    6
    Views
    1,313

    >char input[5] = "hello"; char...

    >char input[5] = "hello";
    char input[6]="hello"; // input[5]=='\0'
    or char input[]="hello"; // sizeof(input)==6
  11. Replies
    6
    Views
    1,313

    u should ask "compiler" first.

    u should ask "compiler" first.
  12. Thread: Please Help Me

    by winbill
    Replies
    5
    Views
    1,104

    The rand function returns a pseudorandom integer...

    The rand function returns a pseudorandom integer in the range 0 to RAND_MAX. Use the srand function to seed the pseudorandom-number generator before calling rand.

    BTW: in vc's...
  13. Replies
    1
    Views
    902

    >for(x=0;x

    >for(x=0;x<strlen(str)-i; x++){
    for(x=0;x<=strlen(str)-i;x++){
    //str[strlen(str)]=='\0'
  14. Replies
    4
    Views
    1,672

    execlp("clear",0); or execlp("tput clear",0);

    execlp("clear",0);
    or execlp("tput clear",0);
  15. Thread: Seen this one?

    by winbill
    Replies
    15
    Views
    1,749

    http://www.ioccc.org/winners.html#alphabet

    http://www.ioccc.org/winners.html#alphabet
  16. Replies
    4
    Views
    1,138

    #include #include int...

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

    int main(void)
    {
    char scale[12];
    float temp;
    float temp2;

    printf("Would you like to convert Fahrentheit or Celsius?\n");
  17. Thread: memcpy check

    by winbill
    Replies
    2
    Views
    1,775

    void *memcpy( void *dest, const void *src, size_t...

    void *memcpy( void *dest, const void *src, size_t count );

    dest : New buffer

    src : Buffer to copy from

    count : Number of characters to copy
    ~~~~~~~~~~~~~~~~~~~~~~~~

    The memcpy function...
  18. Replies
    4
    Views
    1,138

    strcmp(scale,"Fahrenheit"); or case insensitive...

    strcmp(scale,"Fahrenheit");
    or case insensitive
    _srticmp(scale,"Fahrenheit");
  19. Replies
    5
    Views
    1,181

    declared the structure out of main, or u can't ...

    declared the structure out of main, or u can't "see" it in details1.
  20. Replies
    13
    Views
    1,520

    do not press the function key. The getch...

    do not press the function key.

    The getch function reads a single character from the console without echoing. getche reads a single character from the console and echoes the character read. Neither...
  21. Replies
    13
    Views
    1,520

    in function messageEncoding >*pMessage++;...

    in function messageEncoding

    >*pMessage++;
    >*pMessage2++;
    ->
    pMessage++;
    pMessage2++;

    add *pMessage2=0;
    before display the encrypted message
  22. Replies
    13
    Views
    1,520

    in function main() >char *p = &message;...

    in function main()

    >char *p = &message;
    should be char *p=message;

    > getMessage(*p);
    > isValid(*p);
    > encrypt(*p);
    ->
    getMessage(p);
  23. Replies
    3
    Views
    1,617

    estimating the area of graph by many small...

    estimating the area of graph by many small rectangles will be a better way.
  24. Replies
    1
    Views
    1,520

    function atoi() [atol() or strtol() ] convert a...

    function atoi() [atol() or strtol() ] convert a string to int [long].
    and _itoa() or sprintf(StringBuffer,"%d",Integer) covert int to a string.
  25. Thread: pop function

    by winbill
    Replies
    12
    Views
    6,360

    hmm, but it make the same mistake. if the linked...

    hmm, but it make the same mistake.
    if the linked list has only one item.
    Like
    [1]->NULL

    >if((*tos)->next != NULL) *tos = (*tos)->next;
    >I don't go there if it is NULL.

    so after...
Results 1 to 25 of 36
Page 1 of 2 1 2