Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- //#include "polmul.h"
- typedef union _pol {
- int length;
- int* asArr;
- struct _part {
- int start;
- int end;
- int **pol;
- } asPart;
- } *pol;
- int mymax(int a, int b) {
- return (a>b)?a:b;
- }
- pol alloc_pol(int length) {
- pol ret = malloc(sizeof(union _pol));
- ret->asArr = malloc(sizeof(int)*length);
- ret->length=length;
- return ret;
- }
- void initialise_pol(pol p) {
- int i;
- for (i=0; i<p->length; i++) {
- p->asArr[i]=0;
- }
- }
- pol allocinit(int length) {
- pol ret = alloc_pol(length);
- initialise_pol(ret);
- return ret;
- }
- int main() {
- allocinit(10);
- return 0;
- }
Add Comment
Please, Sign In to add comment