User Profile
Collapse
-
binary output
i know that it is not too hard to write a function to convert a num to binary and print it out but do we really have to? i see we can use %o and %x for octal and hexidecimal. so i am wondering is there any inbuilt function for binary as it seems kinda wierd that there is binary operators but not binary format. ta -
There is nothing wrong with it!
Sometimes a newline is required at the end of your program.
All i can suggest is for you to put in a new line at the end of the file, that is press return to add an extra line. if this does not work i dont know because all i did is copy and paste then added the new line and it worked perfect. -
makefile problems, undefining objects
i have 3 drivers,
bst:
gcc -o bst -D BST driver3.c parser.c bst.c common.c
ll2:
gcc -o ll2 -U BST driver2.c parser.c ll.c common.c
ll1:
gcc -o ll1 -U BST driver1.c parser.c ll.c common.c
i know this is fine and it works for what i am doing but i want to create object files. however if i do the following
commonbst.o:
gcc -D... -
if all you want to do is measure time taken then do this.
#include <time.h>
#include <stdlib.h>/*this is for the NULL (i hope)*/
double start,end;
start=time(NULL );
/*your code to be timed goes here*/
end =time(NULL);
printf("time taken is %f",end-start);
i hope this is what you mean!Leave a comment:
-
redefine structures and functions
hello, i am working on an assignment so i wont be getting into specifics i just want some general help. so here is the situation...
i have mutliple drivers. driver one runs a BST insert and search it also intialising the entire structure and frees the memory. the nodes are a struct. parent, .left , right etc the structs name is WordType... driver2 is much the same but WordType is not a tree node anymore it is just double link list...
No activity results to display
Show More
Leave a comment: