Search:

Type: Posts; User: Queue

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    5,602

    stringstream with escape characters

    I've been trying to incorporate escape characters into stringstream, but I cannot figure out how to implement this correctly for the life of me. At the moment, I cannot even compile the program...
  2. Thanks for your post, grumpy. However, the...

    Thanks for your post, grumpy. However, the sysadmin has limited our local access to the point where we cannot even set our own screensaver, much less password protect it.

    I was looking more into...
  3. Yes, you are correct. I can save things to a...

    Yes, you are correct. I can save things to a network drive, but I do not have access to the local registry.
    The local machine is part of the network. However, I think the sysadmin placed quite a few...
  4. Well, to clarify a bit, I do not have a local...

    Well, to clarify a bit, I do not have a local account on the machine. I logon via an account set up through Active Directory and connect to the domain. I'm quite positive that I do not have access to...
  5. Reimplement Lock Feature Without Installation Privileges

    The workstations at my workplace do not allow for us to lock our computers, nor do they allow us installation access. Therefore, I am wondering if it is possible to reimplement the Windows Lock...
  6. Thread: reading a file

    by Queue
    Replies
    38
    Views
    5,488

    If I'm not mistaken, the compiler cannot locate...

    If I'm not mistaken, the compiler cannot locate the prototype for malloc, so you must add this somewhere in your code:
    #include <stdlib.h>
  7. After rethinking over the design, I believe that...

    After rethinking over the design, I believe that I may in fact implement the parser as a FSM. In addition to all the previous functionality, I believe that multiple wildcards may improve its...
  8. I'm curious as to why you consider it a hack job....

    I'm curious as to why you consider it a hack job. If the reason is simply the amount of time you put into it, that makes sense. Looking at the code, though, I must say I don't really see how it could...
  9. Unfortunately, the parsing doesn't get much more...

    Unfortunately, the parsing doesn't get much more complex than what I've shown thus far. Still, I'm very curious as to what a full-fledged FSM looks like code-wise (especially without the use of a...
  10. Thanks for posting that, Dave_Sinkula. Of course,...

    Thanks for posting that, Dave_Sinkula. Of course, now that I've seen another way to accomplish the same goal, I'm curious to know why you've implemented some parts the way that you did.


    Instead...
  11. Ah, I misinterpreted your blue highlighting as a...

    Ah, I misinterpreted your blue highlighting as a link. I still would be interested in how parse_field would be implemented, though.
  12. Could you provide that link, so that I can...

    Could you provide that link, so that I can understand how it would actually work?
  13. Thanks, Salem. Any suggestions and/or criticism...

    Thanks, Salem. Any suggestions and/or criticism on the rest of the code?
  14. Please critique and suggest improvements for parser

    Overview: parse_field acts like fgets, except while fgets returns lines, parse_field returns whitespace delimited fields. However, unlike fgets, which simply returns the next line, parse_field also...
  15. Replies
    9
    Views
    1,785

    I just realized that each field could possibly...

    I just realized that each field could possibly have more than just one ampersand. How would I take this into account if I were to modify post #6? A simple while loop would not work, as the memory...
  16. Replies
    5
    Views
    5,093

    Unfortunately, the reading must be in C to keep...

    Unfortunately, the reading must be in C to keep it consistent with the rest of the program. Prelude's post answered my question completely. Thanks everyone for all the help.
  17. Replies
    5
    Views
    5,093

    The only method I know of continually reallocates...

    The only method I know of continually reallocates memory to a char* while adding the character to the last element. Personally, I want to avoid realloc if possible. Has anyone written a function...
  18. Replies
    5
    Views
    5,093

    fgets without specifying size

    Is it possible to pull one line at a time from a stream without specifying the buffer size (unlike in fgets)? Also, is there any way to store that line into a char*? Thanks.
  19. Replies
    9
    Views
    1,785

    Thanks, Dave_Sinkula, for the actual...

    Thanks, Dave_Sinkula, for the actual implementation. One quick question:
    field = malloc(replen + len);should look more like
    field = malloc(replen + len + 1);because of the null terminator, right?
  20. Replies
    9
    Views
    1,785

    That's definitely not difficult to change, but...

    That's definitely not difficult to change, but I'm having trouble coming up with the actual implementation and code for the '&' swap, even with the correct memory allocation.
  21. Replies
    9
    Views
    1,785

    Thanks, dwks. I understand how to implement the...

    Thanks, dwks. I understand how to implement the memory allocation part now, but I'm still stumped when it comes to implementing the actual replacement. Could you please clarify that a bit?
  22. Replies
    9
    Views
    1,785

    Extend parser functionality without realloc

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

    int main(void) {
    const char* line = "user1,user2,&,user4 group1,group2,group3 string1 string2 string3";
    const char*...
  23. Replies
    14
    Views
    1,888

    So it's basically a style/personal choice? Thanks...

    So it's basically a style/personal choice? Thanks everyone for all the input.
  24. Replies
    14
    Views
    1,888

    strncpy(s3, s2, len); sprintf(s3, "%.*s", len,...

    strncpy(s3, s2, len);
    sprintf(s3, "%.*s", len, s2);
    while(len--) *s3++ = *s2++;
    *s3 = 0;Which is most preferable?
  25. Replies
    14
    Views
    1,888

    How about char s1[] = "This is an example...

    How about
    char s1[] = "This is an example sentence.";
    char *start = s1;
    while (*start != ' ') ++start;
    char *end = start;
    while (*end != ' ') ++end;
    size_t len = end - start;
    char *s3 =...
Results 1 to 25 of 35
Page 1 of 2 1 2