Search:

Type: Posts; User: timhxf

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    1,827

    what does this statement do?

    If I had a integer n, what does the statement n>>=1 do? convert n to binary, then shift to right one bit? or n stays in decimal format then gets shifted? Thanks.
  2. Replies
    8
    Views
    1,885

    thanks all. I know that my code is wrong. I just...

    thanks all. I know that my code is wrong. I just wondered why it worked at my machine. I am a new comer for C, do not know how the compiler works. So, just a bit curious:)
  3. Replies
    8
    Views
    1,885

    I compiled this code, and I only got an warning...

    I compiled this code, and I only got an warning saying passed the imcompatible pointer type, but the program works!
  4. Replies
    5
    Views
    1,300

    but when I pressed the second time, scanf()...

    but when I pressed the second time, scanf() should return '0' and it should break out. how can you explain this?
  5. Replies
    8
    Views
    1,885

    passing pointer argument

    hey, it is me again. I have another question in my mind, ok, this is the code:


    #include<stdio.h>
    #define max 15
    void average5(double a[]);
    int main(void)
    {

    static double...
  6. Replies
    5
    Views
    1,300

    the scanf function

    i have a code like this:


    int store(double a[],int limit)
    {
    int i=0;
    while(i<limit&&scanf("%lf",&a[i])==1)
    i++;
    return i;
    }
  7. Replies
    2
    Views
    1,269

    i want to print a array

    i have written code to print array rain[3][5], the code is like this:


    #include<stdio.h>
    void f1(float a[][],int c);

    int main(void)
    {
    int a;
    float *b;
  8. Thread: what is wrong?

    by timhxf
    Replies
    2
    Views
    1,051

    what is wrong?

    i have written the code below:


    #include<stdio.h>
    void copy1(float a[],float b[],int c);
    void copy2(float *d,float *c,int a);
    int main(void)
    {
    int a;
    float *b;
  9. Replies
    5
    Views
    1,352

    function with array arguement

    hey, i have written this code just to transfer a few number of elements from one array to another two arrays, but I had some problem calling the function. Below is the code:


    #include<stdio.h>...
  10. Replies
    3
    Views
    1,022

    thanks, guys, i understand better!:)

    thanks, guys, i understand better!:)
  11. Replies
    3
    Views
    1,022

    pointer and array

    i have an array, let's say "float rain[5][12]", and i have a pointer "float *p", when I make the statement like this"p=rain", then I got a error saying imcompatible pointer type. could anyone...
  12. Replies
    3
    Views
    1,015

    I can get the result if I use "ar[i]*=mult;" can...

    I can get the result if I use "ar[i]*=mult;" can you tell me why? the result will be assigned to ar[i], but this is a value inside the array, can it be assigned to that?
  13. Replies
    3
    Views
    1,015

    I am stuck at the last line

    #include <stdio.h>
    #define size 3
    void show_array(int ar[],int n);
    void mult_array(int mult,int ar[],int n);

    int main(void)
    {
    static int dip[size]={1, 2, 3};
    printf("the original...
  14. Replies
    2
    Views
    1,129

    need some help for precedence

    If "ar" is a pointer to an element in the array, then what does the following statement do?


    *(ar++)*=2;


    the precedence thing is driving me crazy, where can I find some detailed introduction...
  15. Replies
    3
    Views
    1,095

    i am more clear now, thanks guys!

    i am more clear now, thanks guys!
  16. Replies
    3
    Views
    1,095

    precedence problem

    I have seen a code like this:


    #include <stdio.h>
    int data[2]={100,300};
    int moredata[2]={200,400};
    int main(void)
    {
    int *p1,*p2,*p3;
    p1=p2=data;
  17. Thread: about EOF

    by timhxf
    Replies
    3
    Views
    1,262

    about EOF

    I have used a while statement to test the EOF, if it sees EOF, the program should exit. I used command like this "my program<a.txt" and it worked, but when I ran it in the command prompt, I use...
  18. Replies
    5
    Views
    1,214

    what is wrong with this code?

    I have written a piece of code to a character and display it a number of times defined by the user, but I got error seems in the scanf statement, can somebody help me? thanks


    #include<stdio.h>...
  19. Replies
    1
    Views
    956

    why I cannot compare the value?

    this a simple program to compare two numbers, but it cannot display the correct result, what I got is always "0.00". why?


    #include<stdio.h>
    double small(double x,double y);
    int main(void)
    {
    ...
  20. Replies
    4
    Views
    1,347

    thank you

    I see, thanks for you guys to help me, sorry for the bad indentation, I should improve on that also.
    I did a review of my code, and came out the code here:


    #include<stdio.h>
    int main(void)
    {...
  21. Replies
    4
    Views
    1,347

    what is wrong with the input?

    hi, I am a new lover of C,I have recently written the code below, it is a program to guess the number.


    #include<stdio.h>
    int main(void)
    {

    int a;
    char response;
Results 1 to 21 of 22