The only thing that I see you saying is that you don't know what you are trying to do. If you have a specific question about radix sort, what is it?
I just finished implementing radix sort in C...
Type: Posts; User: jcarouth
The only thing that I see you saying is that you don't know what you are trying to do. If you have a specific question about radix sort, what is it?
I just finished implementing radix sort in C...
Yes because if the previous element is the head of the list, then I will need to add it to the beginning, and I need a way to signal that to the calling function. Thus in the calling method we have:...
Thank you for your advice, even though it may be unrelated to the question.
The code is in no way complete as it stands but I appreciate your tips.
I'm trying to implement a list interface in C. It is a sorted list with items declared as
typedef struct {
char* str;
int len;
} Item;
I think the problem is in this function. I can create...
what do you think this section of code is doing? information is a variable of type struct. You cannot create a pointer to a variable in this manner. You could, however do something like this:
...
Haha, yeah that's what I get for not checking my work. The forum compiler didn't seem to catch that one. :D
sean_mackrory says:
A database error occurred while this thread was being split. This post was not intended to be a part of this thread. Apologies to those whose posts in the initial thread were...
this works too
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
bool OpenInputFile(ifstream& infile, string& inputpath)
{
try {
//if file is empty
throw "File is empty";
//read in data from file
//if too many elemnts
throw "Too many elements error.";
//do more stuff
}...
You need to read up on the keyword extern. But to use the variable lives in the graphics.c file, you must declare extern int lives in the graphics.c file.
The extern keywords means that the...
/*This program will compute the area of a rectangle, */
/*triangle, circle, ellipse, and sphere. */
#include <stdio.h>
#include <math.h>...
meant to be ((double)(1)/2)....sorry
areaTri = ((double)(1/2))*(baseTri*heightTri);
I didn't read where you declared areaTri, but I assumed it is of type double.
or
areaTri = (1/2.0)*(baseTri*heightTri);
will also work
Thank you nkhambal. It compiled and ran on the machine in question. Can I ask you to explain the changes you made?
That was the idea.....
There are no empty lines in the input file.
Doing a
fgets(line, sizeof(line), fp);
puts(line);
//sscanf code
I get an output string of
5
INPUT FILE
---------------------------
5
Jeffrey Carouth 371625342 MATH152 4 3 PHYS218 4 4 ENGR111 2 4 HIST105 3 3 CPSC206 4 4
Bob Dillan 873193526 MATH151 4 3 PHYS218 4 4 ENGR111 2 3 KINE199...
I have a program that compiled on my i386 running suse linux with
gcc -Wall student.c and runs perfectly.
When trying to compile and run the same program on a unix machine, I am recieving a...
Sorry forgot that one line, it was part of a debug attempt.
I realize that in the code I posted I had changed the struct declaration of student to incorporate an array of courses of fixed size....
I'm working on an assignment and can't seem to figure out how to properly allocate space for a flexible array member of a struct type in a second structure. The application is as follows:
...