Ohh okay I get it now. I didn't realize that the addresses should be stored like that. And sorry, this was just a quick code I came up with, but it pretty much follows the format of my own...
Type: Posts; User: ChickenChowMinh
Ohh okay I get it now. I didn't realize that the addresses should be stored like that. And sorry, this was just a quick code I came up with, but it pretty much follows the format of my own...
So, I'm in the midst of implementing my own malloc() and free() functions, but I'm having a hard time with the syntax of getting the address that malloc returns. Whenever I check the address, it's 0....
I reiterate my drawings into my code, but I think my issue is syntax. I'm kind of uncomfortable with passing structs and such.
The only thing that's a downer is that my class doesn't allow us to...
I actually have a paper filled with doodles of different possible linked lists and it seems correct to me. But then again, I've been trying to write this code for hours. So, I maybe off..
How do I go about updating the list itself instead of the copy? This whole time I was assuming that "List" was actually being updated ><
Is there anything wrong though with the initial implementation of my code though?
For instance:
When I input 1, 2, and 3 and print out the list. Only 3 would print out..
I'm not really sure how to change my program around this. Forgive me, I'm rusty with the syntax.
Hey,
So, I've been working on this all day and I'm going crazy as to why my linked list isn't actually linking together. What I mean is that when I print it out, it will only print out the node...
So, I'm having a really dumb moment and I cant seem to remember how an if statement works, with only the variable name as the condition.. :(
if(var){
//then do something
}
oh got it! I didn't really understand makefiles that well until I read a bit more into it and it's not as bad as I thought it'd be. I realized that I was making my makefile longer than it should have...
Thanks. I have my makefile working now. Though, is there a way to make the executable not "a.out", but a variable called "formula"..so that I can call the program like "./formula blahblah"
Oops. I didn't even notice that. Thank you for noticing.
It worked! Thank you! Now, I have a makefile that I use to run my programs. How would I incorporate nCr.s into my makefile?
Here's my makefile in case..
COMPILER=gcc
CFLAGS = -ansi -pedantic...
Okay, I'll try it. I'll let you know in a minute!
Sorry, I forgot to mention..when I ran my program with full C code, it obviously didn't have that "include nCr.s" line. It just had the regular "include nCr.c". But when I incorporated the assembly...
So I'm having trouble linking my assembly code into my C code. Simply, I have one program, but I'm using two different source codes to implement this one program.
For the assembly code, I simply...
haha you're right. I was too busy looking at the first few lines of main that I didn't realize that this program actually computes fibonacci values. Thanks so much.
Okay, so I trying to do this, but the command I'm putting in may be wrong.
command: "gcc -c mystery.s"
I keep getting these errors..
error: suffix or operands invalid for 'push'
error:...
I have this assembly code that I'm trying to convert to C. I'm currently having trouble understanding it though. I've tried to compile it with Nasm, but I get numerous amounts of error. It could be...
:D The one thing I'd like to see is if I could sort a list of words with different cases and numbers :X I'm gonna make a few changes to see if I can implement that!
Wow that works perfectly. Thank you so much!
Okay I'm getting a bit closer now lol. Here's what I have..
EXPECTED OUTPUT
adam
banana
cheese
dog
hello
oval
ruler
nothing happened :(
I've noticed though that the only thing that got swapped was "cheese" and "hello".
EXPECTED OUTPUT
adam
banana
cheese
dog
hello
oval
ruler
Here's a mini version of my main function...
#include <stdio.h>
#include <string.h>
int main(int argc, const char *argv[]){