finally got this to work, though it has too much in main(), I had problems/crashes every other way...
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#define nameSize 50
struct...
Type: Posts; User: DLH112
finally got this to work, though it has too much in main(), I had problems/crashes every other way...
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#define nameSize 50
struct...
Can someone please give me a hint as to what I'm doing wrong? I've fussed around with this so much and it just won't run properly.
void readData( Node *p, FILE *input )
{
while(fgets(buffer,...
I've restarted it and perhaps found my problem. readData...
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
struct NODE
{
struct NODE *link;
int value;
I know that you're right, and I apologize for the um irresponsible request, but I really hate the feeling that just changing 1 or 2 things that I'm overlooking could make it run perfectly.
I will...
It compiles, but crashes upon running. uses this text file
081 1986 71 143 029198 Baum Adam
015 1968 65 120 020509 Dente Al
094 1960 74 155 029836 Fresco Al
098 1986 51 073 037558 Romeo Alf
090...
that is what my previous assignment was(the basic linked list with just a number), and I understand the basics of it like you said. This program that I started with for this assignment is the...
ah okay, i'll rethink it. It's supposed to read data from a file(text file) and put each line of that text file as a node on the linked list.
------------------Edit--------
now the readData part...
Right, thanks, that parts settled now. looks like this
struct NODE
{
struct NODE *link;
int id, birthYear, height, weight, salary;
char firstName[nameSize], lastName[nameSize];
};...
All right so my first post was a wall of text without a solid question. I've done something now and it needs some fixing.
I've changed the struct and the insertFirst function but am having a problem...
I have to modify this program so that it will use a linked list instead of the current system, as well as add in a insertFirst function and a freeList function.
/* Mini-data base. Somewhat more...
ah okay, I made a second node that the increment function is done on before being "traversed". Is there no way to go back to the beginning of the same list/node?
#include <stdio.h>
#include...
I unexpectedly had to work a lot on some other project today, and was not able to access the internet or work on this program as much as i had wanted. It is pretty much finished but I'm still having...
Because I need to put the data into the same slot of the array as the ID number(i.e. employee with ID # 56 goes in data[56]). The way you stated what to do makes it sound like that would be...
Still doesn't work, but maybe with this it's clearer what I'm trying to accomplish:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct
{
int id;
...
I had a feeling I couldn't do that, then standard input...
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct
{
int id;
int...
okay, so right now its this:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct
{
int id;
int birthyear;
int height;
...
I'm trying to make a program that gets several lines of data from standard input, where each line represents an employee.
Each line looks something like this: 081 1986 71 143 029198 Baum Adam
(ID...
yup, now it works, yay. I wasn't sure if just argv was right for the first parameter and I tried various forms of image to get it to compile but thank you, that was quick and now it works :].
My overall assignment is to write a program that draws 4 concentric circles, editing an example program that makes 1 circle. I've gotten it done almost but 1 part is causing me trouble. I need it to...
sorry, I think I've made it better now:
#include <stdlib.h>
#include <stdio.h>
main (int argc, char** argv )
{
int Key = atoi(argv[2]);
FILE *in, *out;
int ch = *argv[1];
here's what I have now, it seems to work, but it might only appear that way. I need to make a file of all 0's to check it.
#include <stdlib.h>
#include <stdio.h>
main (int argc, char** argv )...
wow, i just realized a huge flaw in my logic, the if statement should look something like this
if ( argc != 5 || (*argv[1] != 'e' && *argv[1] != 'd') )
ok, I get that that part is what is wrong, but what would I do to make it check if what they type for that argument E, e, D, or d?
edit: can I make the parameters of main whatever I want? so there...
Sorry, I was about to leave when i posted it, right now the problem is that it just prints "copy source dest"
Here's what I'm supposed to do:
Write a program (in C), which enciphers or deciphers an input file.
Assume that the input file is any type of file, at all. So you must read it in
using binary...