Search:

Type: Posts; User: Wicket

Search: Search took 0.00 seconds.

  1. Replies
    1
    Views
    4,185

    Problems with the eight queens problem

    I heard from a friend of mine of the eight queens problem and I write a program to find all solutions to it. My problem is that it doesn't find any solutions and Wikipedia says there must be 92...
  2. Replies
    6
    Views
    1,353

    A yes. You're right. I always want to swap that...

    A yes. You're right. I always want to swap that to around. In a more normal for-statement I always see it directly that that's wrong. In this case I looked after the crash to that statement and...
  3. Replies
    6
    Views
    1,353

    I now || means or. Else I will have the problem...

    I now || means or. Else I will have the problem that the statement will be false if I get i = 6 and j = 10. It must stop before it gets there. So it needs an or.
  4. Replies
    6
    Views
    1,353

    Complex for-statements

    I have got this four for-statements in a program of mine:



    for (int i = a + 1, j = b + 1; i < 8 || j < 8; i++, j++)
    {
    field[i][j] = -1;
    filled++;
    cout << i << ' ' << j << endl; // Just...
  5. Replies
    2
    Views
    2,923

    Thanks for the information.

    Thanks for the information.
  6. Replies
    2
    Views
    2,923

    Reading multiple data types to file

    If got a problem for reading multiple data types to a file using operator>> and getline.

    Let say I've got the following code:


    #include <iostream>
    #include <string>
    #include <fstream>...
  7. Replies
    22
    Views
    4,188

    At last, it is working. Thanks everyone, not...

    At last, it is working.

    Thanks everyone, not only for the functions to get working but also to understand some more things.
  8. Replies
    22
    Views
    4,188

    And how must I fix it, or is there a easier way...

    And how must I fix it, or is there a easier way to write and read wstrings and strings to a file?

    Must I use operator<< and operator>>?
  9. Replies
    22
    Views
    4,188

    What do you mean that I am writing outside my...

    What do you mean that I am writing outside my memory. I can't see it in the code. After len++ I allocate memory: len-1 for all tokens and the last one for '\0'. I don't see that I am writing '\0' in...
  10. Replies
    22
    Views
    4,188

    Yes, the functions are working good and I am...

    Yes, the functions are working good and I am understanding it better. There is something in testfile.dat.

    I have only the problem left that the program doesn't crash if I remove the line wcout <<...
  11. Replies
    22
    Views
    4,188

    1. len is the number of wchar's. I have replaced...

    1. len is the number of wchar's. I have replaced wfin.read(str_w, len) by wfin.read(str_w, len*sizeof(wchar_t)); and the same for wfout.read(...);
    2. This will not fail because there is a statement...
  12. Replies
    22
    Views
    4,188

    Maybe it is because of my bad English but I don't...

    Maybe it is because of my bad English but I don't still understand how I must solve the problem and I don't understand the problem itself very well (why does the write function for the normal string...
  13. Replies
    22
    Views
    4,188

    wifstream crashes the program

    I am having problem to write a wstring to a file. I have made functions to write and read strings and wstrings but for a reason the I don't know it doesn't work for wstrings.

    Here is my header
    ...
Results 1 to 13 of 13