puts a pointer to storage allocated for the new record into newentry and inserts the new record on stack s; this version does not check for overflow but could do so (how to do it depends on what malloc does when it runs out of storage)

newentry = malloc(sizeof(stackrecord));

newentry->info = pnewrecord->info;

newentry->link = *ps;

*ps = newentry;

}