Search:

Type: Posts; User: nicoeschpiko

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thanks a bunch! My pointer had the correct...

    Thanks a bunch! My pointer had the correct values stored all along.
  2. The first cout statement is what is confusing me...

    The first cout statement is what is confusing me the most (i.e. why I'm seeing a blank line rather than '1'). Could you address that output, or lack thereof? Thanks
  3. Implementing space allocated for a character array

    I hope the title did a decent job of summarizing my issue. I am trying to extend a two dimensional algorithm to a 3 dimensional solution, and am having some trouble storing my slice files. I have...
  4. Replies
    10
    Views
    1,398

    Correct. I simply mentioned the use of a string...

    Correct. I simply mentioned the use of a string to string map to more directly present a workaround and close the thread.

    I understand that dirp is the same each time, and that d_name, the...
  5. Replies
    10
    Views
    1,398

    I used that (not in the code above, but since my...

    I used that (not in the code above, but since my last post), but am still getting the same issue. I've noticed that if i use a map of string key, string value, then the problem goes away. I'll...
  6. Replies
    10
    Views
    1,398

    how would you suggest to convert filename to...

    how would you suggest to convert filename to conform with the regexec functions aforementioned second parameter type (const char *) to avoid a compile-time type error?
  7. Replies
    10
    Views
    1,398

    In case it helps, the result of that final loop...

    In case it helps, the result of that final loop is:

    0001 : 0307.pnm
    0002 : 0308.pnm
    0003 : 0309.pnm
    0004 : 0310.pnm
    0005 : 0311.pnm
    0006 : 0312.pnm
    0007 : 0313.pnm
    0008 : 0314.pnm
  8. Replies
    10
    Views
    1,398

    forgot to mention, i had to make a copy of d_name...

    forgot to mention, i had to make a copy of d_name in a char*, as that is what the regexec f(n) is going to expect.
  9. Replies
    10
    Views
    1,398

    I have implemented the suggestions in the...

    I have implemented the suggestions in the following code block, however I am still getting the same result:


    int getFilesFromDir(char* directory, MapType &files) {
    DIR *dp;
    ...
  10. Replies
    10
    Views
    1,398

    use of the STL with map

    I am experiencing some unexpected behavior when trying to use map to store some filenames given a directory. My code looks like this:


    typedef map<string, char*> MapType;


    int...
  11. Thanks for the ideas folks. Much appreciated!

    Thanks for the ideas folks. Much appreciated!
  12. builtin function for getting current directory

    In my program I use chdir a number of times, and was wondering if there is a function that returns the directory in which the program is contained? I am looking for an alternative to:

    1) create a...
  13. I noticed that when i only have the #defines in...

    I noticed that when i only have the #defines in the header, and nowhere else, everything compiles fine. I can also properly use the variables in both the corresponding .c file, and any other c file....
  14. if i only declare the variable in the header...

    if i only declare the variable in the header file2.h as:


    struct line { char *string_var; int some_const; };

    extern int CONST_1 = 1;
    extern int CONST_2 = 2;
    extern int CONST_3 = 3;

    and...
  15. I did want a global const, so I took laserlight's...

    I did want a global const, so I took laserlight's advice of implementing the #define. Now I have:

    file2.h

    struct line { char *string_var; int some_const; };

    extern CONST_1;
    extern CONST_2;...
  16. I now have the following files: file2.h ...

    I now have the following files:

    file2.h

    struct line { char *string_var; int some_const; };

    extern int CONST_1;
    extern int CONST_2;
    extern int CONST_3;
  17. Sorry for being misleading, I was going to put...

    Sorry for being misleading, I was going to put the word list in my post in quotes. I suppose I should have, or stuck to the vernacular used in the title.
  18. How to get length of array of char arrays

    I have variable char ** string_list. Is there a function to obtain the number of "strings" in this list?
  19. One last question: How/where would i declare a...

    One last question:

    How/where would i declare a variable (either in whatever.h or file1.c from the most recent post above), say called INTCONST which is equal to 5, that can be used in file2.c and...
  20. Thanks everyone for the wonderful discussion and...

    Thanks everyone for the wonderful discussion and guidance. Much appreciated!
  21. how to use one .c file variable in another .c file

    I have a file file2.c containing a table:


    struct table_row { int int_var; char *char_array1; char *char_array2; };

    struct table_row a_table[] = {
    1, "row 1, column 2", "row 1, column 3",...
  22. termios.h: B0 => "Hang up"...what does this mean

    In the termios.h file the integer constant B0 is said to mean "Hang up". What does this mean exactly? I've looked for an answer to this but can't seem to find one. Thanks!
  23. Replies
    6
    Views
    30,193

    perfect. Thanks!

    perfect. Thanks!
  24. Replies
    6
    Views
    30,193

    how to write a null character to a file

    I have a file descriptor fd, and would like to use it to write a null character \0 to the connected file. I am trying to write this using:


    write(fd, '\0', 1);


    however, this doesn't seem to...
  25. Replies
    4
    Views
    1,759

    whoa! The problem was that my function char*...

    whoa! The problem was that my function char* parameter variable (which in this particular use case, takes a file passed by the user) was not null terminated. More surprising is that the string was...
Results 1 to 25 of 50
Page 1 of 2 1 2