Search:

Type: Posts; User: C-Struggler

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,660

    I realize that is one way of doing it, but I was...

    I realize that is one way of doing it, but I was hoping to basically place the x and IX values into one array and the y and YI values into another.
  2. Replies
    3
    Views
    1,660

    Joining arrays?

    Hi everyone.

    If I have the following arrays:

    arrayx...........arrayy
    x1.................y1
    x2.................y2
    x3.................y3

    ...
  3. Replies
    2
    Views
    1,096

    I forgot to mention that this is only partially...

    I forgot to mention that this is only partially the code that I have. The value of 'n' is actually initialized. Sorry about that...I should have posted everything I guess.
  4. Replies
    2
    Views
    1,096

    Another math question

    I'm taking a different approach to my program after getting some input from some of the forum members.

    My first question is if I want to display a result that can either be negative or positive,...
  5. Replies
    6
    Views
    3,441

    Currently nothing is assigned to the x...

    Currently nothing is assigned to the x value...I'll later want to substitute a number in for x, but not at this stage...When I ran the short code I had above...I got a funky number like y = 65750 or...
  6. Replies
    6
    Views
    3,441

    I tried just doing a test with this code y...

    I tried just doing a test with this code


    y = x * x;
    printf("%i", y);


    This didn't work. If I used this formula, I would want it to print x^2.
  7. Replies
    6
    Views
    3,441

    Math equations

    Hi everyone,

    I am working on a program to basically multiply some equations.

    For example:

    (x + 1) * (x + 1)

    How would I code this so that my answer shows
  8. Replies
    3
    Views
    2,708

    Okay...I changed some things on it and got it a...

    Okay...I changed some things on it and got it a little closer to working properly....It may help more if I display the full program....The file that the program is reading from has the following in...
  9. Replies
    3
    Views
    2,708

    Eliminating duplicates

    Hi everyone...I'm trying to eliminate duplicates from my array...The program compiles find but hangs and will not execute...Could someone look at my loops for eliminating the duplicates and tell me...
  10. Replies
    4
    Views
    1,326

    Quick Q - Array to File

    I'm sure there is likely a simple solution to this, but my brain has turned to mush working on this code.



    while(i > 0)
    {
    printf("%d\n", array[--i]);
    }
  11. Replies
    5
    Views
    877

    Array format

    I think I could weed out the duplicates by using an array, but how could the code be changed so that it places each character into an array?
  12. Replies
    5
    Views
    877

    Writing non-duplicates

    I have a file called Junk2.txt which looks like this when opened.
    1
    2
    2
    3
    4
    5
    5
    5
    The file is already sorted from smallest to largest. The program that I have now can write all of the...
  13. Thread: Exiting

    by C-Struggler
    Replies
    3
    Views
    1,077

    Should have known

    Thanks for your help. I should have know it was something simple...I've got it working now.
  14. Thread: Exiting

    by C-Struggler
    Replies
    3
    Views
    1,077

    Exiting

    I'm having a problem with my program exiting when I want it to. I want it to exit the program completely if 'q' is pressed, yet it goes on to the 'menu' function even if 'q' is pressed....Can...
  15. Replies
    1
    Views
    896

    Writing non-duplicates

    I was wondering if someone could give me some assistance with my program. What I have right now is a file called 'duplicates.txt' which contains the following integers I maually entered:
    1
    1
    2...
  16. Replies
    5
    Views
    2,393

    Appologies

    My appologies....I misunderstood. I do see what you mean and will post with code tags from now on...I won't bother reposting this one, but from now on will do it that way. Sorry about that.
  17. Replies
    5
    Views
    2,393

    comments

    I hope I've commented this well enough to get a better idea of what I'm doing and trying to do.


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

    //enum to set FALSE to 0 and...
  18. Replies
    5
    Views
    2,393

    enumeration

    Hi,

    I'm having two problems with my code. One is implenting enumeration into it....And the other (which is frustrating because it's USUALLY easy to do) is getting it to exit when the user does...
  19. Replies
    1
    Views
    1,499

    qsort Explanation

    Hi Everyone,

    I was wondering if someone could give me some help in understanding the following code and what certain parts mean.

    Please speak in lamens terms. The final return statement is...
  20. Replies
    2
    Views
    1,297

    Thanks Prelude. Very much appreciated.

    Thanks Prelude. Very much appreciated.
  21. Replies
    2
    Views
    1,297

    malloc and realloc

    Hi everyone,

    I was wondering if someone could go over my code to check to see if I did this right. Basically what this program is supposed to do is allocate enough memory for 10 random...
  22. Replies
    4
    Views
    7,219

    Random Characters

    There is probably a simple solution to this, but my mind is drawing a blank right now.

    I know how to get a random letter...

    srand( time(NULL) );
    randChar = rand( ) % 26 + 'a';

    I know...
  23. Replies
    4
    Views
    2,195

    That would be another question about how would I...

    That would be another question about how would I implement a union into this??
  24. Replies
    3
    Views
    1,017

    Comparing Strings?

    If I have a some pre-defined string names array such as

    char *pet_names[] = {
    "Dog",
    "Cat"
    };

    and I want to prompt the user to enter an Animal name such as

    printf("Enter a...
  25. Replies
    4
    Views
    2,195

    Unions and Structures

    Hi everyone. I've been struggling a bit with some code using unions and structures. Right now, I'm just trying to get the following code to work the way I want it too. The way it SHOULD work is...
Results 1 to 25 of 25