Search:

Type: Posts; User: Sue Paterniti

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    5
    Views
    980

    Hi Kip, I have typedef'd an int vector as ...

    Hi Kip,
    I have typedef'd an int vector as typedef vector<int> INTVEC;
    Then typdef'd the map as typedef map <string, INTVEC > HEADINGMAP;
    and an iterator as typedef...
  2. Replies
    5
    Views
    980

    creating a

    Thanks Kip,

    I have included your code - but am now getting compile errors...

    error C2143: syntax error : missing ',' before '&'

    does hmap have to be declared elsewhere - in a .h ?? It says...
  3. Replies
    5
    Views
    980

    creating a

    I have a map <string, vector of ints> and would like to display what I hope I have loaded into the map...however, it appears that I have to define a << operator that takes a type HEADINGMAP (my map...
  4. Replies
    2
    Views
    951

    Compling a module without a main

    I have a module pgm that contains only definitions and functions. I have not included a main() statement.

    The module does have an associated header file.

    When I compile the module I am getting...
  5. Replies
    25
    Views
    3,505

    Thanks for the critique - sebastiani - actually I...

    Thanks for the critique - sebastiani - actually I am not trying to simplify anything - just trying to learn the syntax for passing parameters as pointers - and when it is appropriate to do so - as is...
  6. Replies
    25
    Views
    3,505

    HA HA HA HA (much hysterical laughter!!!) I...

    HA HA HA HA (much hysterical laughter!!!)

    I think it is working!!

    I have passed the file mode (as a char array of 2) to the modules - and used that during the file opens.

    It seems to be...
  7. Replies
    25
    Views
    3,505

    it must be getting late - i am babbling.... I...

    it must be getting late - i am babbling....

    I have altered the fp to an fp1 (see last note)

    I am now attemping to read the output'd binary file into the 2nd pgm - I have opened the file via the...
  8. Replies
    25
    Views
    3,505

    Interesting that my stat'd file_info (even...

    Interesting that my stat'd file_info (even though) a static - does not remain between calls....

    I am trying to confirm that that is the case -

    however, can you please confirm -

    in the...
  9. Replies
    25
    Views
    3,505

    OK - here we go - I have a call to the function...

    OK - here we go -
    I have a call to the function
    collectstat(fp);



    ???? collectstat(FILE *fp, name_type in_file) {
    if (access(in_file,0) == 0) {
    ...
  10. Replies
    25
    Views
    3,505

    wow!!! I'm not sure if I can process all...

    wow!!!

    I'm not sure if I can process all that.....

    yes, the input file is a text file that contains the names of files to be stat'd (one per record).

    I was hoping to be able to read a...
  11. Replies
    25
    Views
    3,505

    The fp is defined in the calling pgm ie FILE...

    The fp is defined in the calling pgm
    ie FILE *fp;

    and also in the mod.c module code
    static FILE *fp
    Sue
  12. Replies
    25
    Views
    3,505

    Some joy!!!!! I removed the * from the...

    Some joy!!!!!

    I removed the * from the return(*fp) - and it compiled and got a bit further in the pgm....

    Can you please advise how I can pass the file pointer returned from the open to another...
  13. Replies
    25
    Views
    3,505

    Hammer, Hmm, no luck - I am still getting...

    Hammer,

    Hmm, no luck - I am still getting compile errors "incompatible types on return"

    The code I have is as follows:

    in the module header:
  14. Replies
    25
    Views
    3,505

    Thanks Hammer, I will try as you suggest.... ...

    Thanks Hammer,

    I will try as you suggest....

    in regards the passing of the file mode - yes, of course - I don't need to pass that.....

    Thanks for your assistance

    I will have another...
  15. Replies
    25
    Views
    3,505

    more: open file from a module

    Hammer,

    I have tried to incorportate some of your suggestions, but although the module compiles - I am getting "incompatible types in assignment" compile errors from the calling pgm.

    In the...
  16. Replies
    25
    Views
    3,505

    File opens from a module

    Thanks Hammer,

    I am having trouble with this pgm....the requirement is to have a pgm access a module -

    Can you please tell me -
    I have labelled my variables in the module (mod.c) as static -...
  17. Replies
    3
    Views
    1,416

    No - I think I am the idiot here!! The calling...

    No - I think I am the idiot here!!

    The calling pgm has the requirement to collect stat information for selected files and write the information to another file.

    So - I thought I would call the...
  18. Replies
    3
    Views
    1,416

    collecting stat info from a module

    I have a pgm calling a function in a module.

    The program is to pass a file name to the module function - and then the module function will collect the stat information and return the stat info to...
  19. Replies
    25
    Views
    3,505

    Passing parameters to a module

    I have a couple of programs which open files, and need to create a module which has the fopen code - and then pass the file and mode parameters to the module.

    I have included code in my calling...
  20. Replies
    3
    Views
    5,731

    Checking for file existence

    Can anyone suggest how I can check for a files existence prior to using it...

    I have found a code called F_OK - but am not sure of the syntax to use it.

    many thanks
    Sue
  21. Replies
    8
    Views
    4,082

    more info on seg. fault

    I have managed to get some more information on my segmentation fault.

    the error message is

    home/spaterniti/wrkshops/b1: no such file or directory

    I can see the file when I do a "ls" command...
  22. Replies
    8
    Views
    4,082

    segmentation fault in reading binary file pgm

    Salem,
    thanks - I have made your suggested changes.
    The first program compiles and runs without error.

    The second program compiles - but throws a segmentation fault error when it runs.

    Can...
  23. Replies
    8
    Views
    4,082

    read binary file

    Thanks Salem and Shadow,

    I'll try again:

    This is the code I wrote to create the file.




    #include <sys/types.h>
  24. Replies
    8
    Views
    4,082

    code as requested

    I have attached the code.

    Salem, I have read the link you suggested, but am not sure what is the relation to my code problem.

    Please advise.

    Thanks
    Sue
  25. Replies
    8
    Views
    4,082

    code as requested

    Hi Salem,
    Here is the code that wrote the binary file.

    regards
    sue
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <stdio.h>
    #include <string.h>
    #include <time.h>
Results 1 to 25 of 32
Page 1 of 2 1 2