okay that seemed to be my issue i just made the file name now just "out" because it ignores the .txt extention and will write to the binary file
my issue is now making sure that i correctly output...
Type: Posts; User: adramalech
okay that seemed to be my issue i just made the file name now just "out" because it ignores the .txt extention and will write to the binary file
my issue is now making sure that i correctly output...
okay so i still have the error from the fwrite i found out it wasn't the student structure that i was writing to it but more the file stream wasn't substantiated i even tried to open the binary file...
it has nothing to do with bitfield operations as i have tried both ways and none of them seem to make anything different in the error same thing....
thanks for the clarification i was confused that i would need to use a bitfield operations to make sure it has the right size.
the error i get is this: 0x00c1fc38 in fwrite () from...
okay well i made them all unsigned ints but i am having issues with the fwrite statement:
#include <stdio.h>
#include <stdlib.h>
#include "student.h"
void addStudent(){
student...
i have to make every structure under 44bytes!!!
that is why i try to get the smallest allowed type to each variable without getting any overflow errors...
idNumber can be up to 9 digits...name...
here is the code i get from addS.c:
In file included from addS.c:3:
student.h:15: warning: type of bit-field `gender' is a GCC extension
addS.c: In function `addStudent':
addS.c:8: warning:...
okay so i have fixed alot of errors in my code and it is much better, but i have seemed to stumble upon an error i cannot figure out maybe one of you could be of more assistance than me just starring...
okay finally got some source code to show i still am having some issues with arrays and pointers...but this is as far as i have got...
student.h (aka header file)
#include <stdio.h>
#include...
okay so your like saying do this:
while(!eofe(file_ptr)){ <--to make sure doesn't seek beyond the limit of written data
then use fseek to set to to beginning of file with SEEK_(whatever it...
okay so i am now writing code for an assignment where i have to write to a binary file a report for a teacher to use for a class where it will write to the file in this format:
idNumber ...
okay so i looked through my code and even further simplifed the insert function the delete function now takes care of all cases, and i also have go through and rewrote my list function to be able to...
okay i will try and see if next = null will help out...
okay so after a long night and no sleep i figured it all out...but i still have a problem with listing the numbers after i insert it...
#include <stdio.h>
#include <stdlib.h>
#define...
well i don't know what i should have....i can just traverse it but without printing out at every time i increment cur i won't have a list function!!!
i thought that:
next = (node *)(cur->link ^...
well see i am incrementing a pointer to next so i can traverse the list....those three lines are how i would traverse the list and i then output what is in cur->data until i get to the end...
it...
okay i got the insert function working, i got the delete function working correctly, but i am having problems with the list function...here is what my program looks like with just dumby variables as...
thanks...that was an eye opener it took me some time but i figured out that i forgot to set head and some of the others to what was made!!!
okay so i think i got the insert function down....but it is inserting memory allocations!!! because those numbers aren't even close to being in the 1 to 9999 range!
i think i might be passing by...
well i was thinking because i am using dynamic variables that would be wanting to use malloc??
using the stdio.lib size of function...ohh and this is a homework assignment so i don't have much say...
i have a delema with my xor linked list program....now i keep getting the bottom error i will also get segmentation errors throughout the insert function!!!
i have the list commented out at all...