Search:

Type: Posts; User: slee8251

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    1,259

    Yes, the problem did go away after I fixed the...

    Yes, the problem did go away after I fixed the initialization.
    Appreciate the second pair of eyes to look over my dumb mistakes.

    Thanks!
  2. Replies
    5
    Views
    1,259

    #include #include ...

    #include <stdio.h>#include <stdlib.h>


    typedef struct node
    {
    void* dataptr;
    struct node* next;
    } NODE;
  3. Replies
    5
    Views
    1,259

    What is wrong with my queue ADT?

    #include "queue.h"

    QUEUE* CreateQueue(void)
    {
    QUEUE* queue;


    queue = (QUEUE*)malloc(sizeof(QUEUE));
  4. Replies
    1
    Views
    997

    pushing strings into a stack

    I am using the STACK ADT which means the data values in the stack are void pointers.

    I am having trouble trying to push strings into the stack because of these void pointers.

    I understand how...
  5. Replies
    2
    Views
    988

    arrays and pointers

    This was an exam problem that I still don't really understand


    int main ()
    int a[10] = {1,2,3,4,5,6,7,8,9,10};
    int *ptr = (int*)(&a + 1);
    printf("%d %d, *(a+1), *(ptr-5) );
    return 0;
  6. Replies
    7
    Views
    9,726

    to clear things up, this is a specific pgm file...

    to clear things up, this is a specific pgm file that I have written code for. I know for a fact the header text goes like this:
    P5\n
    3039 2014\n
    255\n...
  7. Replies
    7
    Views
    9,726

    Windows OS

    Windows OS
  8. Replies
    7
    Views
    9,726

    typo: Because I start reading the image at the 20...

    typo: Because I start reading the image at the 20 byte position, my fread returns value of 6120543 and I malloced 6120546.
  9. Replies
    7
    Views
    9,726

    reading in a binary file (pgm)

    I need to read in a pgm file. Ive determined using ClikView that the image is 6120546 (3039 x 2014) and the total file size is 6120563. Therefore, I know the header file is 17 bytes total.
    ...
  10. Replies
    1
    Views
    1,234

    manipulating strings

    I am writing a program where the user inputs a string and have to make the string "dance" based on a rhythm they also input.

    rhythm 2 : *_*_*_*_ etc.. (where star is capitalized and _ is lower...
  11. Replies
    1
    Views
    992

    math.h and ceil explanation

    #define taxRate .06#include <math.h>


    float legalInput( float minimum );
    float roundUpToPenny( float amount );
    void makeChange ( const float denoms[], int n, float tend, float cost );
  12. Replies
    2
    Views
    918

    oh man, i feel so dumb, lol

    oh man, i feel so dumb, lol
  13. Replies
    2
    Views
    918

    outputting an array

    void printoutput(const float prices[], const char taxable[], const int lines)
    {
    int i;


    puts("Price Taxable");
    puts("----- -------");


    for(i = 0; i<=lines; i++){
  14. Replies
    8
    Views
    2,305

    so is the lesson i should take from this is to...

    so is the lesson i should take from this is to never use floats and doubles in the same program? use one or the other?

    because i changed all my doubles to floats and now i get the right answer. ...
  15. Replies
    8
    Views
    2,305

    double/float output is inaccurate.

    This program is intended to read numbers into an array and to count how many positive, negative numbers there are and to also calculate the total for each category and calculate the average.
    ...
  16. Replies
    7
    Views
    4,232

    yea it was either doing that or Principle = 0.00;...

    yea it was either doing that or Principle = 0.00;

    do you have any other suggestions?

    what i was talking about with the rounding error is that say you have a 1000 loan at a rate of 0.125 and a...
  17. Replies
    7
    Views
    4,232

    #include int main (void) { double...

    #include <stdio.h>

    int main (void)
    {
    double principle;
    double annual_rate;
    double monthly_rate;
    double interest_accrued;
    double...
  18. Replies
    7
    Views
    4,232

    amortization table : rounding errors

    I wrote the a program that displays a table with the interest, payment, new balance, etc. for every month. However, I am getting rounding issues somewhere in the middle of the calculation making the...
  19. Replies
    3
    Views
    3,230

    ahhh thanks you

    ahhh thanks you
  20. Replies
    3
    Views
    3,230

    output formatting (aligning decimal point)

    Can someone tell me what I am mis-understanding or if there is something I need to do? My code is this:

    #include <stdio.h>

    int main (void)
    {
    int diameter=1;
    double radius;

    printf("enter...
  21. Replies
    3
    Views
    1,621

    ahh okay thanks. so if you do (4.0/3.0) it...

    ahh okay thanks.

    so if you do (4.0/3.0) it should work, right?
  22. Replies
    3
    Views
    1,621

    math function (order of operations)

    Can someone please explain the difference between the two, given the same radius? They produce different results. Thanks in advance


    #define PI 3.1416
    volume = (4*PI/3)*pow(radius,3);
    volume...
  23. printf a floating number (more complicated, please read topic)

    I'm beginner to programming in general.

    Say I have:
    int x = 80;
    int y = 6;
    double average;

    average = x / y;

    printf("%f", average);
Results 1 to 23 of 23