Search:

Type: Posts; User: jcarouth

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    1,454

    What exactly is your question

    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...
  2. Replies
    4
    Views
    1,259

    Yes because if the previous element is the head...

    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:...
  3. Replies
    4
    Views
    1,259

    Thank you for your advice, even though it may be...

    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.
  4. Replies
    4
    Views
    1,259

    Linked List implementation

    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...
  5. Replies
    4
    Views
    1,114

    what do you think this section of code is doing?...

    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:

    ...
  6. Thread: try/catch

    by jcarouth
    Replies
    12
    Views
    7,114

    Haha, yeah that's what I get for not checking my...

    Haha, yeah that's what I get for not checking my work. The forum compiler didn't seem to catch that one. :D
  7. Having trouble getting started with Microsoft Visual C++

    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...
  8. Replies
    3
    Views
    817

    this works too #include #include...

    this works too


    #include <iostream>
    #include <string>
    #include <fstream>
    using namespace std;

    bool OpenInputFile(ifstream& infile, string& inputpath)
    {
  9. Thread: try/catch

    by jcarouth
    Replies
    12
    Views
    7,114

    try { //if file is empty throw...

    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
    }...
  10. You need to read up on the keyword extern. But to...

    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...
  11. Replies
    21
    Views
    4,050

    /*This program will compute the area of a...

    /*This program will compute the area of a rectangle, */
    /*triangle, circle, ellipse, and sphere. */

    #include <stdio.h>
    #include <math.h>...
  12. Replies
    21
    Views
    4,050

    meant to be ((double)(1)/2)....sorry

    meant to be ((double)(1)/2)....sorry
  13. Replies
    21
    Views
    4,050

    areaTri = ((double)(1/2))*(baseTri*heightTri); ...

    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
  14. Replies
    9
    Views
    1,180

    Thank you nkhambal. It compiled and ran on the...

    Thank you nkhambal. It compiled and ran on the machine in question. Can I ask you to explain the changes you made?
  15. Replies
    9
    Views
    1,180

    That was the idea..... There are no empty...

    That was the idea.....

    There are no empty lines in the input file.
  16. Replies
    9
    Views
    1,180

    Doing a fgets(line, sizeof(line), fp);...

    Doing a



    fgets(line, sizeof(line), fp);
    puts(line);
    //sscanf code

    I get an output string of
    5
  17. Replies
    9
    Views
    1,180

    INPUT FILE --------------------------- 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...
  18. Replies
    9
    Views
    1,180

    Strange core dump

    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...
  19. Sorry forgot that one line, it was part of 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....
  20. memory allocation for flexible array member of struct

    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:


    ...
Results 1 to 20 of 20