Search:

Type: Posts; User: xp5

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    895

    I would like to break the loop when the last...

    I would like to break the loop when the last digit is detected.
  2. Replies
    3
    Views
    895

    Reading from User's Input

    Hi, I'm trying to read an unspecified number of integers from the user's input. However I don't know how to make it so that the program will keep on scanning after the first integer. I try to...
  3. Replies
    12
    Views
    1,329

    Thank you very much for the in depth...

    Thank you very much for the in depth explanation...that's exactly what I needed!
  4. Replies
    12
    Views
    1,329

    Yes, the code is below: #include ...

    Yes, the code is below:



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

    #define STRSIZE 1000

    int main(void)
  5. Replies
    12
    Views
    1,329

    Yes, I do want to read through the file to see...

    Yes, I do want to read through the file to see how many words there are, and then allocate the memory according to the number of words there are in the file. I'm just having trouble allocating...
  6. Replies
    12
    Views
    1,329

    n was just a variable that i was testing with,...

    n was just a variable that i was testing with, and it is not currently in used. The file story.txt contains: "Today is cold, yesterday was hot"
  7. Replies
    12
    Views
    1,329

    Help with Malloc() function

    Hi,

    I want to be able to store a group of words from a file to an array. I try using the malloc() function to allocate space for all the word in a file, but i'm not sure on how to use the malloc...
  8. Replies
    3
    Views
    2,150

    WOW! thank you, i didn't see that!

    WOW! thank you, i didn't see that!
  9. Replies
    3
    Views
    2,150

    Is it a Palindrome?

    Hi, I'm writing a program that will identify whether or not the user's input string is a palindrome or not. However, the program keeps the inputed string is a palindrome eventhough it is not. It...
  10. Thread: For Loop Problem

    by xp5
    Replies
    10
    Views
    1,773

    I got it!! thank you matsp!

    I got it!! thank you matsp!
  11. Thread: For Loop Problem

    by xp5
    Replies
    10
    Views
    1,773

    The sorting is working perfectly fine now. I...

    The sorting is working perfectly fine now. I have another question, how do I make it print 10 integers per line? For example the sorted array is: "1 2 3 4 5 6 7 8 9 10 11 12 13". How do i make the...
  12. Thread: For Loop Problem

    by xp5
    Replies
    10
    Views
    1,773

    Thank you dwks and matsp !!! matsp: Yes, I...

    Thank you dwks and matsp !!!

    matsp: Yes, I want the former values (the first group) to be sorted with the second group of values too.

    I'm working on that right now.
  13. Thread: For Loop Problem

    by xp5
    Replies
    10
    Views
    1,773

    A different for loop problem

    Hi, this is sorting selection program that i'm writing. The sorting works fine, however, I don't know how to make it so that the program sort a group of values then go to the next group of values to...
  14. Thread: For Loop Problem

    by xp5
    Replies
    10
    Views
    1,773

    hey thanks, I absolutely forgot about the break...

    hey thanks, I absolutely forgot about the break command!!
  15. Thread: For Loop Problem

    by xp5
    Replies
    10
    Views
    1,773

    sorry i figure it out!

    sorry i figure it out!
  16. Thread: For Loop Problem

    by xp5
    Replies
    10
    Views
    1,773

    For Loop Problem

    Hi, I can't seem to get out of the first for loop below, so that it will pass the user inputed array on to the sorting function. Is there something that I'm doing wrong with the first for loop?

    ...
  17. ahhh...thank you!

    ahhh...thank you!
  18. For this part: "maxpos = x[i] > x[maxpos] ? i:...

    For this part: "maxpos = x[i] > x[maxpos] ? i: maxpos; "

    Can someone explains to me what "? i:" means?

    Thank you!!
  19. What is the difference between the two for loops?

    Hi,

    I'm reading this programming book and it gives a sample code:


    int get_maxpos(int x[], int eff_size)
    {
    int i, maxpos = 0;

    for (i = 0; i < eff_size; i++)
  20. Trouble passing information from one function to another function

    I'm trying to pass values from the main() function to the selectionSort() function, but it keeps saying the following:

    hw2n1.c: In function `main':
    hw2n1.c:25: warning: passing arg 1 of...
  21. Replies
    2
    Views
    831

    thanks

    thanks
  22. Replies
    2
    Views
    831

    Stuck in a FOR loop

    Hi, i'm writing a sorting program, and I'm stuck in a for loop and I don't know what's wrong with it. The following is my code:



    #include <stdio.h>
    #define NUM_INT 1000

    int main (void)
    {...
  23. Replies
    10
    Views
    10,373

    Hi I'm trying to use the for loop, but i'm having...

    Hi I'm trying to use the for loop, but i'm having trouble figuring out how to use it. Do you know what i'm doing wrong?



    int n;
    int output[60];
    int index = 0;
    int condition;
    int...
  24. Replies
    10
    Views
    10,373

    yeah, i have to do it without using pow(x,y)

    yeah, i have to do it without using pow(x,y)
  25. Replies
    10
    Views
    10,373

    Can't raise x to the power of y

    Hi, is there a way to raise x to the power of y (x^y), without using the math.h library and the pow(x,y) function?
Results 1 to 25 of 33
Page 1 of 2 1 2