What's the advantage of using pointers vs using the structs direcxtly in this program?
Ie should it be
vector* vector_make_from(int vsize, double* d);
instead?
_____________
#include <math.h>
#include <stdlib.h>
#include "vector.h"
#include <stdio.h>
vector vector_make(int size)
{...
I am getting a segfault when running this, somehow because I'm using double* d wrong in vector_make_from.
I need to use -> and pointers somehow I guess but don't get how.
Should vector_make and *from return a pointer to a vector nit a vector?
______________________________
#include...
fixed it up a bit. problem is how to print a register?
If I can do that it is a lot easier to test the program...
.text # section declaration
# we must export the entry point to the ELF linker or
.global _start # loader. They conventionally recognize _start as their
# entry...
I get a segfault when running this.
I have several questions:
1. How do I print a register, for example eax?
2. Is the factorial function correct? should ret be in the end or could you use it in a cmp-clause?
3. Anything else?
.text # section declaration
# we must export the entry...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.