Search:

Type: Posts; User: Tom_Arch

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    2,980

    Alright so cin is a reference to an ifstream?...

    Alright so cin is a reference to an ifstream? Would I have to open the file before I pass it to myInputFunction? because if the open command was in myInputFunction, would that work with cin?
  2. Replies
    8
    Views
    2,980

    Ok the program is a search program which searches...

    Ok the program is a search program which searches a file for the first command argument, then prints out any line with that in it. If there's only one argument, it uses cin.

    salami testdata.txt
    ...
  3. Replies
    8
    Views
    2,980

    Well if there is no file specified in argv[] I...

    Well if there is no file specified in argv[] I want to read from std input instead. How can that be implemented?
  4. Replies
    8
    Views
    2,980

    Reading from a file in Xcode/using cin

    Hey all,

    In Xcode, do you have to put the text file somewhere special for it to be read? My file opening code runs but is always .fail().

    Also how can I make an ifstream from cin?

    Thanks for...
  5. Replies
    6
    Views
    1,263

    so can you call a method of a class that has no...

    so can you call a method of a class that has no instance, using ::?
  6. Replies
    12
    Views
    1,516

    I'm doing C++ on through xcode 3.1 too at the...

    I'm doing C++ on through xcode 3.1 too at the moment, so I might be able to help. From what I gather gcc is the Gnu C Compiler for C, C++ uses the g++ compiler.

    When you click new project, you...
  7. Replies
    6
    Views
    1,564

    alright thanks quzah I'll try that

    alright thanks quzah I'll try that
  8. Replies
    6
    Views
    1,564

    sorry I meant else { strcpy(filename,...

    sorry I meant


    else {
    strcpy(filename, argv[i]);
    }
  9. Replies
    6
    Views
    1,564

    Ok changed those two, still getting a seg fault...

    Ok changed those two, still getting a seg fault though


    for (i = 1; i < argc; i++){
    .
    .
    .
    else{
    fprintf(stderr, "Usage: tvprogs [-h] [-f filterfile] epgXMLfile");
    return...
  10. Replies
    6
    Views
    1,564

    reading from argv[]

    Hey does anyone have any clue why filename is never getting allocated in the code below?
    I read it afterwards and its giving me a seg fault.


    for (i = 1; i < (argc + 1); i++){
    if...
  11. Replies
    2
    Views
    1,004

    ah genius! thanks

    ah genius! thanks
  12. Replies
    2
    Views
    1,004

    finding command line operatives

    How can I check if the -h operator is included in the command line? It also needs to be next to an html filename?
  13. Replies
    1
    Views
    1,227

    piping a file into my project

    Hey my project (to print out a tv guide) is coming together now. I've tested the lesser parts, but now I need to pipe in an xml file of programmes I get off the net to test my printer.

    The main...
  14. Replies
    1
    Views
    1,205

    Creating a Makefile

    Does anyone know how to create a makefile on mac OS X? I think it needs to be declared a unix executable file
  15. Replies
    4
    Views
    1,872

    What's the difference?

    What's the difference?
  16. Replies
    4
    Views
    1,872

    printing strings

    If you make a null-terminated string, then call printf() on it, will the null character cause a gap at the end of it?

    What happens if you call printf() and the string isn't null-terminated?
  17. Replies
    1
    Views
    3,393

    Iterating through a linked list

    Hey C forum, can someone give me ideas/ psuedocode for iteration through a linked list?
    I'm passing in my super-struct epg which is like this:


    struct epg {
    DateTime epoch; /* The time...
  18. Replies
    11
    Views
    6,481

    Thanks for all this help mats, all these are...

    Thanks for all this help mats, all these are things I just wouldn't have picked up on. I've now changed it. Please, any more tips would be great. Also I still can't visualize how to check if the...
  19. Replies
    11
    Views
    6,481

    shakes I just read the how to post code note ...

    shakes I just read the how to post code note


    DateTime dateTimeFromString(const char *s)
    {
    DateTime result;

    char year[5];
    char month[3];
    char day[3];
  20. Replies
    11
    Views
    6,481

    Sorry for the length DateTime...

    Sorry for the length
    DateTime dateTimeFromString(const char *s)
    {
    DateTime result;

    char year[5];
    char month[3];
    char day[3];
    char hour[3];
    char min[3];
  21. Replies
    11
    Views
    6,481

    Sorry I don't understand why I get a segfault?...

    Sorry I don't understand why I get a segfault? I've now changed it like:
    char *test = NULL;
    char *buff = NULL;

    But gdb still gives me the KERN_PROTECTION_FAILURE at address: 0x00001ffa.
    How...
  22. Replies
    11
    Views
    6,481

    The code in my main function is: char *test;...

    The code in my main function is:

    char *test;
    char *buff;
    DateTime firstTry;
    strcpy(test, "20090312150317");
    firstTry = dateTimeFromString(test);
    makeDateString(firstTry, buff);
    ...
  23. Replies
    11
    Views
    6,481

    How to pass in an array/struct as argument

    Hey I'm having trouble understanding my error message

    "incompatible type for argument 1 of ‘makeDateString’"

    The function in question has the declaration

    void makeDateString(const DateTime...
  24. Splitting a string to retrieve multiple integers

    Hey I need help to understand how to read integers from a continuous string. For example s might be "20090310150506" (the double-quotes are not characters in the string), denoting 2009/03/10...
Results 1 to 24 of 24