@jsaurabh181: "#include <stdlib.h>
#include <stdio.h>
int main()
{
    int *a=malloc(sizeof(int));
    char *b=a;
    a=4;
    printf("a:%d\n",*a);
    printf("b:%s\n",b);
    printf("b as an integer:%d\n",*b);
    free(a);
}
Theoretically this shouldn't even work. Yet it works. I don't know what 
malloc returns. What is the semantics/syntax of malloc? And how does 
this relate to static type and dynamic type? Is this a form of dynamic 
type in C? Or is this something to do with the syntax/semantics of 
<type> * ?"
    @jsaurabh181: "<quote>
Better yet:
#include <stdlib.h>
#include <stdio.h>
int main()
{
    int *a=malloc(sizeof(int)*1);
    char *b=a;
    b[0]='w';
    b[1]='t';
    b[2]='f';
    b[3]=0;
    printf("a:%d\n",*a);
    printf("b:%s\n",b);
    printf("b super wtf:%d\n",*b);//should be same as *a =/
    free(a);
    return 0;
}"
    @gvcormac: "<quote>
No it doesn't.  At least not with the current version
of RunC.
foo.c: In function �main�:
foo.c:6: RunC error: initialization from incompatible pointer type
foo.c:7: RunC error:assignment makes pointer from integer without a cast"
    @aianus: "<quote>
malloc returns a void pointer (a special pointer type that allows 
pointing to any variable type, but cannot be dereferenced directly)
since sizeof(int) is 4 and sizeof(char) is 1, malloc(sizeof(int)*1) is 
equivalent to malloc(sizeof(char)*4)
when you go *a, u dereference the pointer as an int, which gives u the 
full 32 bit number stored at that location on the heap.
when you go *b, you dereference the pointer as a char, which gives you 
only the leading 8 bits."
    @y43guo: "How do you assign a as 4 when you did
<quote>
Do you mean
=/
"Saurabh Joshi" <email_address> wrote in message 
news:hqisa8$ptp$<email_address>"
    @gvcormac: "<quote>
Good.  The C standard permits all sorts of things that
make no sense.  At some point in your career you may
want to delve into them, but for the purpose of this
course, we simply treat them as invalid programs."
{'source': 'USENET', 'other_information': '{"reply_count": 5, "forum_name": "uw.cs.cs136.20150323.mbox"}', 'file': 'data/output/usenet-uw.cs.parquet'}