What kind of code is this? C or C++ : <p>I have written some code for my own practice purpose, but interesting thing happened.  I was originally trying to write a C++ code, however I forgot include streamio library and using namespace std, then I just using printf() function all the way during my coding. </p>

<p>I think the most confusing part to me is I use .cpp extension and compile this program using VS 2015 compiler but I actually wrote in C style. Could someone tell me do I wrote a C or C++ code?</p>

<p>Here is the source code:</p>

<pre><code>#include "stdafx.h"
#include &lt;stdlib.h&gt;


typedef struct node
{
    int data;
    node *next;
}node;

node *create()
{
    int i = 0;
    // Each variable must be assign to some value in the function
    node *head, *p, *q = NULL;
    int x = 0;
    head = (node *)malloc(sizeof(node));

    while (1)
    {
        printf("Please input the data: ");
        scanf_s("%d", &amp;x);
        if (x == 0)
            break;
        p = (node *)malloc(sizeof(node));
        p-&gt;data = x;
        if (++i == 1) {
            head-&gt;next = p;
        }
        else
        {
            q-&gt;next = p;
        }
        q = p;
    }
    q-&gt;next = NULL; 
    return head;
}

void printList(node head)
{
    node *tmp = &amp;head;
    int counter = 0;
    printf("Print out the list: \n");
    while (tmp-&gt;next != NULL) {
        tmp = tmp-&gt;next;
        counter++;
        //surprise to me printf() is pretty advance...
        printf("%d item in the list: %d\n",counter, tmp-&gt;data);
    }
}

int main()
{
    printList(*create());
    return 0;
}
</code></pre>
