Search:

Type: Posts; User: joshlete

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    36,112

    So I got the program all set up and it works. But...

    So I got the program all set up and it works. But only if I use int. Whenever I used unsigned int or unsigned long long int, the program constantly spits out 0 or 1 on to the screen nonstop. Here is...
  2. Replies
    4
    Views
    36,112

    How do I assign a value to a certain c[i] array?...

    How do I assign a value to a certain c[i] array? Also how do would I know how much to assign to the array when declaring it?
  3. Replies
    4
    Views
    36,112

    Converting base 10 to base 2

    Hey guys. I am doing an extra credit assignment where I need to convert any number from 0 to 18,446,744,073,709,551,615. I got down the basic layout to get base 10 into base 2, but backwards. Here is...
  4. Replies
    4
    Views
    6,009

    Also in question 4. The answer is B, right? I...

    Also in question 4. The answer is B, right? I know it can't be A or C, but possibly maybe it's D.
  5. Replies
    4
    Views
    6,009

    Does it matter though? Since char *prt is a...

    Does it matter though? Since char *prt is a pointer pointing to the beginning of the alpha array, which is already defined as constant.



    I see. So then its just "prt = (alpha+3);




    So...
  6. Replies
    4
    Views
    6,009

    Since char *prt is just pointing to a location,...

    Since char *prt is just pointing to a location, does it really matter unless you try modifying it? Writing up the code to test it still gives the right result, I think.



    Oh right, that makes...
  7. Replies
    4
    Views
    6,009

    Some C Pointer Questions

    (1) Declare a char array called alpha, and initialize it to the string “ABCDEFGHIJKLMNOPQRSTUVWXYZ”. In your declaration, make the alphabet array read-only, so none of the letters in the array can be...
  8. Okay that makes sense now. For some reason, I...

    Okay that makes sense now. For some reason, I imagined you can only put 'i' into the brackets of an array for some reason. Knowing I can put an expression in the brackets opened up my mind. Here is...
  9. How would I check if str[i] and str[length-i-1]...

    How would I check if str[i] and str[length-i-1] are the same? Also what is str[length-i-1]? I just learned about Arrays and don't know too much about them.
  10. Palindromes - Determining the _Bool function

    Hey guys!

    I am working on a palindrome assignment and I have pretty much everything figured out up until the end. Here is my code so far:


    #include <stdio.h>#define TRUE 1
    #define FALSE 0

    ...
  11. Replies
    11
    Views
    16,906

    Absolutely solid advice, thanks so much for your...

    Absolutely solid advice, thanks so much for your help. I sort of redid my entire coding after some classes learning about this assignment more. I also included functions to the code as well. Here is...
  12. Replies
    11
    Views
    16,906

    I wasn't ignoring you. I was given partial code...

    I wasn't ignoring you. I was given partial code from my teacher that was written that way, which is the only reason I am even using isPrime(I assume my teacher put it in there for a reason). I am...
  13. Replies
    11
    Views
    16,906

    Okay, so I did some more work on my code. I am...

    Okay, so I did some more work on my code. I am starting to get down the layout of a basic system. I am trying to figure out whats going on because the code will only give out test_int to be...
  14. Replies
    11
    Views
    16,906

    #include #include #define...

    #include <stdio.h>
    #include <stdlib.h>
    #define TRUE 1
    #define FALSE 0
    int main()
    {

    int counter, input, test_int;
    _Bool isPrime;
  15. Replies
    11
    Views
    16,906

    Calculating the nth prime number

    Hey guys,

    I am taking a Intro to C programming class and I am doing an assignment that will calculate the nth prime number. I think, since its earlier on in the class, it should be sort of basic,...
Results 1 to 15 of 15