so am I on the right track with something like:
fgets(recArr[i].ID, 10, fp);
fgets(recArr[i].name, 31, fp);
??
Type: Posts; User: philgrek
so am I on the right track with something like:
fgets(recArr[i].ID, 10, fp);
fgets(recArr[i].name, 31, fp);
??
when I try to use a delimiter i receive a segmentation fault....
The data includes an ID number (9 characters), a name (at most 30 characters), a credit limit, and a current balance.
The data adds a character to the ID and name (for the null character at the end)...
Thanks for reading.
I have a data file with a format as such: an ID # of 9 characters, a name of up to 30 characters, and 2 preceding double values (credit limit and balance).
I am having a...
Yeah, I'm just abandoning the template option. Other than that, the program runs pretty smoothly. Thanks for all the help! I really appreciate it
Unfortunately, I have to turn this in in an hour. I'm not intending to use C++ at all, entirely C. Ugh. Oh well
How do you implement templates in C? I can't find anything other than C++
In absolutely no way did I cheat or "scoop and poop". This is 100% my code, I just don't understand how to use templates so I'm trying to go off what he has in his notes, which apparently as I look...
I'm just trying to go by my prof's notes that he's provided. This part of the lab requires using a template. He includes both C and C++ instructions. Its my first time with templates so I don't know...
This is how my header file looks now
[13:28:33][peg002@lnxAcadShell01][/home/peg002/LAB4]+ cat lib/lib.h
#ifndef lib_h
#define lib_h
#define MaxSize 30
//Define struct//
struct employee {
Thanks. That did work. And i just saw that you had suggested to move the struct definition into the header and include the header in the programs, which i did. and that solved alot of problems. now...
I'm not sure if it helps any, but here is the code for my other functions:
SelectionSort2
#include <stdio.h>
#include <stdlib.h>
#define MaxSize 20
Ok so I've created a header file to include in main (which I'm almost certain I'm doing wrong...I'm new at header files):
[code][13:08:14][peg002@lnxAcadShell01][/home/peg002/LAB4]+ cat lib/lib.h...
[12:50:39][peg002@lnxAcadShell01][/home/peg002/LAB4]+ cat Makefile
#Make file to create LAB4 library and executable
app/LAB4exe: lib/LAB4.c lib/libLAB4lib.so
gcc -o app/LAB4exe -L....
#3. the function pointers are the method I've been told by my prof to use when using dynamic link libraries. they've worked on all the other code i've created.
#2. when I leave it as
struct...
Im down to a deadline and need to solve the problems with this code. When compiling its giving me the errors:
[12:22:05][peg002@lnxAcadShell01][/home/peg002/LAB4]+ make
cc -c -o...
thanks. I tried just moving the app/LAB5exe to a new makefile and that fixed the problem. However now its telling me:
app/LAB5exe: error while loading shared libraries: libRecursionapi.so: cannot...
I'm trying to create a dynamic link library using the following Makefile. The library creation works just fine, however app/LAB5exe never gets created and I'm never given any errors. I'm quite new at...
Sorry for the delay in response.
Yes, SelectionSort() function is in a separate file from the definition of the structure.
And I eliminated the array from that line of code. Thanks for the...
#include <stdio.h>
#include <stdlib.h>
#define MaxSize 30
//Define struct//
struct employee {
char surname[10];
char given[12];
i'm receiving this error on several subprograms in the same place in the program. i can't figure out what is causing it...any help?
#include <stdio.h>
#include <stdlib.h>
void...
thanks for the help :)
Just caught it, its my first time using structs and i didn't realize i needed a semi-colon after the struct definition. sorry for the trouble folks. :-/
This is everything that exists above that bit of code
#include <stdio.h>
#include <stdlib.h>
#define MaxSize 30
int main(){
FILE *inFile;
I have used this bit of code before without problems, however, when using it now, i'm getting the error listed in the title...
I don't see anything wrong with it.. any help?
...