0

hello friends,
i m doing programming in vc++.
but while making a basic program of link list facing a problem.
when i try to add aaloc.h file it turns into atlalloc.h.
there is no file as alloc.h.

#include <stdio.h>
#include <atlalloc.h>
struct node{
    int data;
    struct node *link;
};
void add(struct node *);
void main(){
    struct node *start;
    start=NULL;
    add(start);
    printf("done");
}
void add(struct node *temp){
    printf("one more loop");
}




**pls help how to run this program**
2
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by Ancient Dragon
0

why would you want alloc.h? You don't need it to just allocate memory with malloc(), which is declared in stdlib.h.

Edited by Ancient Dragon

0

thanks for ur reply
but what if i need to use calloc function.
i have read that calloc and malloc fucntion is defined in alloc.h
more specifically : alloc.h is absent in vc++??

1

Both those are declared in stdlib.h, not alloc.h. AFAIK alloc.h is a non-standard extension by gcc and MinGW compilers.

Edited by Ancient Dragon

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.