Search:

Type: Posts; User: clu82

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    17
    Views
    9,780

    Prelude, "I used to see it all too often. " ...

    Prelude,

    "I used to see it all too often. "

    What is your compiler of choice now (for Windows and for Linux)?
  2. Replies
    4
    Views
    1,682

    Xzyx987X, Is this what you mean? #include...

    Xzyx987X,
    Is this what you mean?



    #include <stdio.h>

    int main(void)
    {
    /* use a character as the switch variable */
  3. Replies
    19
    Views
    26,520

    This example should get you close to what you...

    This example should get you close to what you want. More error checking could be added.


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

    #define MAX_ARRAY_INTS 101
    #define...
  4. Replies
    3
    Views
    1,332

    To increment THE VALUE STORED in x: (*tt.c)++ ...

    To increment THE VALUE STORED in x: (*tt.c)++

    Also, this

    printf("value of x %u/n", (tt.c))
    isn't displaying the value stored in x. It's displaying the address of x. You need to dereference...
  5. Thread: Reading a string

    by clu82
    Replies
    11
    Views
    1,478

    strtok returns a pointer to the next available...

    strtok returns a pointer to the next available token.

    Are you wanting to copy a pointer into buffer[loop]? Or are you wanting buffer to point to the location of that token?

    Edit:

    Also, if...
  6. Replies
    2
    Views
    2,119

    Yes, that seems to be it. Thanks for pointing...

    Yes, that seems to be it. Thanks for pointing that out Hammer.
  7. Replies
    2
    Views
    2,119

    Using _kbhit() in a console window.

    This code is for a server. This question is about the code shown in red. I am wanting to add the ability to display stats in real-time when the 's' key is pressed. The code I added only seems to...
  8. Replies
    5
    Views
    1,804

    My apologies as I didn't word my question very...

    My apologies as I didn't word my question very clearly. In Visual Basic, while single stepping through the code, you can change the value of a variable by assigning a new value to it using the...
  9. Replies
    5
    Views
    1,804

    Modifying a char array in VC++ 6 ide.

    It's been awhile since I have used the VC6 ide. Is there a way to change the value of a char array while single stepping through the code?

    example: change the variable sMyString from...
  10. Thread: Too easy?

    by clu82
    Replies
    19
    Views
    2,382

    My guess as to the way the escape sequence works...

    My guess as to the way the escape sequence works is that if the slash character and next character equal a valid escape sequence, then that sequence is used:

    example: fopen("c:\testfile.txt",...
  11. Thread: Text extraction

    by clu82
    Replies
    2
    Views
    1,433

    Try this. Keep in mind, the code will modify the...

    Try this. Keep in mind, the code will modify the string directly.



    #include <string.h>

    void RemoveWords(char *str);

    int main(int argc, char* argv[])
    {
  12. Thread: Static Variable

    by clu82
    Replies
    3
    Views
    1,631

    The main difference is the scope. A static...

    The main difference is the scope. A static variable defined inside a function, can only be used inside that function. The value of that variable will be preserved when the function is finished. ...
  13. Replies
    3
    Views
    1,342

    Here is something to try. Hope you don't mind...

    Here is something to try. Hope you don't mind the rewrite, but there were too many errors with the old code. Let me know how it works. You might need to modify it slightly, as I wasn't sure exactly...
  14. Replies
    6
    Views
    3,495

    tolower() will convert 1 character at a time. ...

    tolower() will convert 1 character at a time.

    Won't you will still need to write some kind of loop to check the string 1 character at a time?


    clu82
  15. Replies
    1
    Views
    936

    Here is a function that will do what you need. ...

    Here is a function that will do what you need.



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

    void RemoveWhiteSpace(char *p);
  16. Replies
    6
    Views
    3,495

    If you don't mind writing you own compare...

    If you don't mind writing you own compare function, you can get that functionality:



    int
    mystrcmp(char *o, char *n)
    {
    while (*o)
    {
    if (tolower(*o) == tolower(*n) )
  17. Thread: NewB Problem

    by clu82
    Replies
    4
    Views
    977

    #include #include int...

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


    int main(int argc, char* argv[])
    {
    while (argc--)
    {
    if (!strncmp(argv[argc], "/r", 2))
    {
  18. Replies
    5
    Views
    834

    First off, using scanf for input is dangerous....

    First off, using scanf for input is dangerous. The user can, and probably will overwrite your buffer. That being said, you need to use a char ARRAY, not just a character variable.

    Also, you don't...
  19. Thread: Do while loop

    by clu82
    Replies
    14
    Views
    1,862

    On my system this code char c =...

    On my system this code



    char c = 'c';

    toupper(c);

    printf("(%c)\n", c);
  20. Thread: Do while loop

    by clu82
    Replies
    14
    Views
    1,862

    In this context, wouldn't the result of toupper...

    In this context, wouldn't the result of toupper need to be assigned back to the 'ans' variable?



    ans = toupper(ans);
  21. Replies
    3
    Views
    7,259

    siddharth, Copy the error messages you are...

    siddharth,

    Copy the error messages you are getting, into this thread. I am using VC++ 6.0 on Win2000. Look in your documentation to see if you have the _ftime() function and the _timeb structure....
  22. Thread: croping strings

    by clu82
    Replies
    6
    Views
    1,369

    Here's a possible solution: #include...

    Here's a possible solution:



    #include <stdio.h>

    void CropString(char *p, int amt);

    int main()
    {
  23. Replies
    3
    Views
    7,259

    If you only need a random number every couple of...

    If you only need a random number every couple of seconds or so, you could try using the milliseconds returned from the ftime function. Use the remainder after dividing by 100 to keep it within the...
  24. Replies
    5
    Views
    970

    I forgot to mention that my code will remove the...

    I forgot to mention that my code will remove the whitespace from the *original* character array, where as Prelude's code will create a *new* character array.
  25. Replies
    5
    Views
    970

    #include #include void...

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

    void RemoveWhiteSpace(char *p);

    int main(void)
    {
    char str[] = "Remove\t\tall white space\n and new lines";

    RemoveWhiteSpace(str);
Results 1 to 25 of 34
Page 1 of 2 1 2