User Profile

Collapse

Profile Sidebar

Collapse
Mindhunter74
Mindhunter74
Last Activity: Jul 26 '11, 09:27 PM
Joined: Oct 7 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Mindhunter74
    replied to Weird behavior of a pointer
    in C
    @Faldahlawi
    This is not true actually.
    Although a is defined before b in the code, b has a lower address than a. It should be cp+=1 because cp is initially set to &b.

    Note: If I changed cp to be initially set to a and changed the operation to cp-=1 , I still have the same weird behavior that the output is not correct (b) unless I print &b somewhere in the code.
    See more | Go to post

    Leave a comment:


  • Mindhunter74
    started a topic Weird behavior of a pointer
    in C

    Weird behavior of a pointer

    The program below should outputs 'a' but it doesn't unless the commented line is uncommented.

    I use MinGW compiler.

    Code:
    int main()
    {
        char *cp;
        char a = 'a';
        char b = 'b';
        cp = &b;
        cp+=1;
        //printf("ap=%p\n",&a);
        printf("%c", *cp);
        return 0;
    }
    See more | Go to post

  • Mindhunter74
    started a topic Pre-increment in C++
    in C

    Pre-increment in C++

    Why would the following statement assign 12 to x not 11?
    Code:
        int i=4;
        int x = (++i) + (++i);
        cout << x; // prints 12
    See more | Go to post

  • Mindhunter74
    replied to HTML colspan problem
    Unfortunately It still doesn't look like as I want.
    ...
    See more | Go to post

    Leave a comment:


  • Mindhunter74
    replied to HTML colspan problem
    Aren't there 3 columns, not 2? I count the colspan of 2 as being 2 columns....
    See more | Go to post

    Leave a comment:


  • Mindhunter74
    replied to HTML colspan problem
    I'm not sure I got what you said.

    Yes, it looks fine when I add a row at the beginning with 3 columns but doesn't work without it.

    <table border>
    <tr><td>A</td><td>A</td><td>A</td></tr>
    <tr>
    <td colspan="2">A</td>
    <td>A</td>
    </tr>

    <tr>
    <td>A</td>
    <td...
    See more | Go to post

    Leave a comment:


  • Mindhunter74
    started a topic HTML colspan problem

    HTML colspan problem

    I want to do an HTML table like the following:



    I wrote the following code to generate it:

    <table border>
    <tr>
    <td colspan="2">A</td>
    <td>A</td>
    </tr>

    <tr>
    <td>A</td>
    <td colspan="2">A</td>
    </tr>
    </table>


    But...
    See more | Go to post
No activity results to display
Show More
Working...