Search:

Type: Posts; User: wjday

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    1,270

    instances of a structure in a structure

    Hi,

    I have the following structure, made up of four structures:-



    struct customer_details {
    struct1;
    struct2;
    struct3;
  2. Replies
    1
    Views
    936

    Using classes as data members

    Hi,

    I've asked this question before but although I got a solution that worked, I didn't understand why it did. Bassically, I have a class that sets up a point, and then another class that uses...
  3. Thread: classes

    by wjday
    Replies
    7
    Views
    1,289

    As a matter of interest, how would I overload the...

    As a matter of interest, how would I overload the << operator?
  4. Thread: classes

    by wjday
    Replies
    7
    Views
    1,289

    Sorry, it does work!!!!!!!!! Thanks, Bill

    Sorry, it does work!!!!!!!!!

    Thanks,

    Bill
  5. Thread: classes

    by wjday
    Replies
    7
    Views
    1,289

    that brings up the same error message. Any other...

    that brings up the same error message. Any other ideas?

    Thanks,

    Bill
  6. Thread: classes

    by wjday
    Replies
    7
    Views
    1,289

    classes

    Hi,
    trying to teach myself C++ and have ran into the following problem......

    I have created a class "point" to hold a coordinate. I then have another class "circle" which records a radius and...
  7. Thread: problem with cin

    by wjday
    Replies
    8
    Views
    1,273

    well done that man. Now works fine....no...

    well done that man.

    Now works fine....no mention of .cpp extensions in book though!!!

    Thanks again.

    Bill
  8. Thread: problem with cin

    by wjday
    Replies
    8
    Views
    1,273

    the code is..... #include //...

    the code is.....

    #include <iostream.h>

    // -------------
    // PROTOTYPES
    // -------------

    int calculateArea(int height, int width, int depth);
  9. Thread: problem with cin

    by wjday
    Replies
    8
    Views
    1,273

    problem with cin

    Hi,
    This is my first day at trying to teach myself C++, although I do have experince of C.

    The problem that I have is that using Microsoft Developer Studio, when I include <iostream.h>, the...
  10. Replies
    11
    Views
    5,453

    thanks for your interest, i've solved it like...

    thanks for your interest, i've solved it like this.....

    commentsRemoved = (strstr(copy, "//"));

    if (commentsRemoved) {
    (int)commentsRemoved = commentsRemoved- copy;
    ...
  11. Replies
    11
    Views
    5,453

    sorry, i don't understand what you mean with your...

    sorry, i don't understand what you mean with your new suggestion.

    is there any way that i could use the strstr function (which recognises whole strings)? Something along the lines of when it finds...
  12. Replies
    11
    Views
    5,453

    But they're allowed by Microsot developer studio...

    But they're allowed by Microsot developer studio and i have to cater for every possibility.

    With the /*....*/ comment, I will have the same probem, as the strtok function seems only to recognise...
  13. Replies
    11
    Views
    5,453

    still having no joy. Any more ideas? Thanks

    still having no joy.

    Any more ideas?

    Thanks
  14. Replies
    11
    Views
    5,453

    ignoring comments

    Hi,

    Trying to write a program that reads C files and so need to ignore comments. I'm using the strtok function

    strtok(myline, "//")

    to remove single line comments. However, this tokenises...
  15. Thread: output to file

    by wjday
    Replies
    2
    Views
    1,441

    output to file

    Hi,

    I've written a program and want the output to go to file. My data is stored in a linked-list and a function is called to loop through the list and print it, using something like
    ...
  16. Replies
    7
    Views
    977

    occurences in a string

    is there a c function that counts the number occurences of a character in a string. For example, given
    somthing like...

    (apple, p)

    will return 2 (for two p's)?

    Thanks,

    Bill
  17. Replies
    6
    Views
    1,265

    i sort of know what the problem is but still need...

    i sort of know what the problem is but still need a little bit of help...

    char line[1000] is getting passed to the 1st function where it is being tokenised. When the 2nd function tries to use...
  18. Replies
    6
    Views
    1,265

    "line" is decalred as... char line[1000]; ...

    "line" is decalred as...

    char line[1000];

    i'm trying to read a text file line by line. the two functions that i call don't modify the line, though i am ready the tokens by splitting it...

    ...
  19. Replies
    6
    Views
    1,265

    functions won't work together

    Hi,

    I'm reading in a file called openInFile and then passing it line by line to two functions as follows....

    while (fgets(line, sizeof(line), openedInFile) != NULL) {
    ...
  20. Replies
    1
    Views
    927

    is a header file the answer?

    I am writing a prog. which performs tools on a variety of other C progs. When I know that paths of these files, I can store them as an array in my source code.
    However, I want to be able to...
  21. Replies
    6
    Views
    9,177

    if I have char delim[] = "\t " then the prog....

    if I have char delim[] = "\t " then the prog. works fine, but when I add \n to it, (ie: char delim[] = "\t in") it compiles but I get the message that the programme has performed an illegal operation...
  22. Replies
    6
    Views
    9,177

    thanks mate, i think i understand the strtok a...

    thanks mate, i think i understand the strtok a lot more now. I'll give your suggestion a go but i think it will work. can't understand why your fontsize is so big though!!!!

    Bill

    PS. Can I ask...
  23. Replies
    6
    Views
    9,177

    Am using.... while (fgets(line, sizeof(line),...

    Am using....

    while (fgets(line, sizeof(line), openedInFile) != NULL) {
    splitTokens(line);
    }

    to open file and send each individual line to splitTokens, which has (char string[]) as...
  24. Replies
    6
    Views
    9,177

    carriage return when tokenizing

    Hi,

    I am using fgets() to read in a series of lines from a text file, then splitting this into tokens using strtok(). These tokens are then compared to an array of other tokens, and printed if the...
  25. Replies
    2
    Views
    7,581

    reading in files token by token

    hi, can someone help me with this (hopefully) minor problem...

    I want to open a C file and read it in word by word (or split it into tokens as is possible in Java). This is so that I can recognise...
Results 1 to 25 of 25