Search:

Type: Posts; User: NewbGuy

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    3,712

    This is what I did and it worked. Thanks all....

    This is what I did and it worked. Thanks all. Learned a lot with this thread.
  2. Replies
    14
    Views
    3,712

    Ah! Thanks guys. That would make sense. If the...

    Ah! Thanks guys. That would make sense. If the char is signed, and it's a negative number, then a bit shift converts the char to an int, and fills up the most significant byte with 1's, so that when...
  3. Replies
    14
    Views
    3,712

    They are 01000000 and 00010100. Then they are...

    They are 01000000 and 00010100. Then they are OR'd together, which should produce 01010100, then that should be moved into p
  4. Replies
    14
    Views
    3,712

    Signed/Unsigned char issues

    signed char n = -94;
    unsigned char p;

    p = (n >>3) | (n << (8-3));

    putc(p);


    Signed char n is -94, which is 10100010
    After doing a bit rotate, it should be 01010100, which is then put into...
  5. Replies
    2
    Views
    4,444

    Yeah that was the problem. Thank you!

    Yeah that was the problem. Thank you!
  6. Replies
    2
    Views
    4,444

    Having trouble with atoi

    I have a function that is returning a string that looks like this:



    char* getstring(char choice)
    {

    does some stuff...

    return(mystring);
  7. Replies
    3
    Views
    1,200

    Is that the drop down beside the green play...

    Is that the drop down beside the green play button on the main menu? It says debug already.
  8. Replies
    3
    Views
    1,200

    How to use a simple breakpoint

    Hi I am trying to do something which should be very simple yet I can't get it to work.

    I have visual studio 2005 here, and I am trying to use breakpoints in my program.

    I put some breakpoints...
  9. Can someone tell me why this doesn't work? It is...

    Can someone tell me why this doesn't work? It is supposed to simply get a character press from the user and if that character isn't equal to A, B or C, it should print "Error! Enter again!". When I...
  10. Ok for the most part, I have solved the problem...

    Ok for the most part, I have solved the problem of the user entering longer numbers than i wanted, but I still have a problem with the user entering the wrong type of data.

    If I ask for a decimal...
  11. How to limit user input to a certain number of digits?

    I am writing a pretty simple program.

    There are a few different inputs I need to get from the user.

    1) Single character.

    I am using getchar() for this, and it works well, but I've noticed...
  12. strstr returns a pointer to the position of the...

    strstr returns a pointer to the position of the word in the string. After I have this pointer, do I then use that pointer in a for loop and count the number of spaces from the pointer until the end...
  13. How to search a string for a word/character and return its position?

    If I had a string, say: "This is a string"

    How would I search for a particular word or character and get it's position into an integer?

    For instance, say I wanted to get the position of "a",...
  14. Replies
    5
    Views
    1,245

    Anyone?

    Anyone?
  15. Replies
    5
    Views
    1,245

    Are you referring to using fgetc instead of...

    Are you referring to using fgetc instead of fscanf? Won't fgetc only get one character at a time? Including all of the spaces and returning a char instead of an int? Because I need to do math on...
  16. Replies
    5
    Views
    1,245

    Very basic File I/O help

    I have a text file with one column of numbers. Eventually these numbers need to be added, averaged etc...but for right now I'm just trying to read them in, then print them out. My main problem is...
  17. Replies
    3
    Views
    2,125

    Switching two words around in a string

    I was wondering if someone could point me in the right direction here.

    A pointer to a string is passed into a function, the string contains a few different words and numbers separated by spaces....
  18. Thank you that works. One problem though, what if...

    Thank you that works. One problem though, what if there were two numbers in that sentance? ie: "Parts contained in the box are 893 and 398 in box B" and I just wanted the second number?
  19. Is there something to just change it into an int?...

    Is there something to just change it into an int? I just need to do basic addition/subtraction. Also, if I know the number's position in the string, how do I use strtol knowing the number's position...
  20. Need help converting portion of string to integer

    I am trying to pull a portion of a string out and turn it into an integer so that I can do some calculations with the value, but I can't figure out how to do this for the life of me. Can anyone point...
Results 1 to 20 of 20