sorry, no need to download:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "student.h"
Type: Posts; User: breanne
sorry, no need to download:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "student.h"
okay, can someone tell me why my code doesn't write more than one record to the file??? it'll write one okay, but if i want more than one, then it chokes and prints a whole bunch of crap to the...
the complication arises when i try to split the main function into two separate functions (readfile and writefile)...but those are minor bugs....i've just gotta format the user interface better....
...
i think that it would be easier if i stated my desired outcome, cause im turning into a real grouch trying to figure out these bugs.
I have an array of students:
struct student
{
char...
why would calling fscanf return a segmentation fault???
i also got an error that said "bus error"...i've never seen that before, can anyone explain?
wonderful::: hammer's input is the kind that i find the most...hmm...enjoyable: lots and lots of info.
I've been reading a lot of posts concering the use of gets, fgets, scanf, getchar....all discussing the issue of portability. while scanf is the easier choice to use (for those who are lazy), why...
i figured it out...i needed to use a FILE pointer for the third argument of fgets...jeez, i was stuck on that for the longest time....ugh.....
doomo
another fgets question, this line of code chokes when i use it:
>fgets(sarray[index].name, 25, fname);
at this point: index=0, sarray is a name of students, name is a character array in the...
thanks for the fgetc, but i was looking for something that did the work for me (of course, i am extremely lazy)...but i will be forced to deal with my own coding inadequacies....
as for the malloc...
i have two problems actually:
1) in c++, you can use the 'getline' function to read in a line that is terminated with a specified delimiter..is this at all possible in c? I am assuming that i'd...
so, i actually want to be using a fstream...like this:
//code
fstream myfile;
myfile=open("myfile.txt");
//
will this create the file if that file is not found?
the thing that's kind of messing me up is that i have file being opened and read by the constructor in one class, and then being written to by the deconstructor in that same class...so i dont think...
i have a program that it a little wacked (cause i suck at programming)...anyway, i need some clarification on input and output to/from a file.
if you declare:
//code
fstream myfile;...
oh my, that error disappearing was the best rabbit that a magician could pull out of their hat....
...thank you so very much...i will a wonderful two hours of sleep tonight...if i can get the rest...
i have a defined a struct that looks like this:
//code:
struct record
{
char name[25];
char address[80];
int yearofbirth;
char telno[15];
};
i figured it all out, use getline...ah, i should listen when other people speak, on top of thinking before i speak....
"what a wonderful world it would be"...if i only i could practice what i...
the complicated stuff, i have a minority kind of understanding on...like the concept of a linked list...of course, it would be the implementation of such that's got me pulling my hair....
the...
of course, i am programming for a class that finishes in hmm....about 38 hours now, during which time i need to finish one project and begin(as well as complete) four assignments.
i am...
"i should learn to think before speaking"
okay, i think i got somewhere. i wouldn't be able to format something around the null-termination, because i press <enter> on every line, which is what...
i got the strcat, but to make life even more exciting, let's say that i dont know how the user will choose to input the information.
john smith
123 green way
nowhere, usa 12345
or
john...
let's say that i wanted to take user input, that was on separate lines, and wanted to store that input in a single array. how could that be done?
for example, i have a mailing address that i...
thats how bad this is, i didnt even realize that i didnt post it in the c++ board.
okay, so i procrastinate, and have no idea how to do any kind of file i/o in C++. can anyone give me the "cut-to-the-chase" version of low level file i/o???
all i really want to do is take user...
Gods you two are, Gods i tell you.
doomo very much, now i can take a nice refreshing shower and take my eyes off the screen for a second or three.