Re: Writing a .txt file



What you can do is redirect stdout so that your program's output is
written
to a file. For that, invoke your program like this:
yourprogram.exe > output.txt

Do you mean I have to invoke my program in the console?

No. That's just one way of doing it.

my goal ist not to write the array in the file only
the j and S value for every count of the loop.

Second thing here is the fact that you are using C++ but passing arrays as
pointer/size combo. You should have used a std::vector instead. Further,
it
isn't even done correctly, the size should use a size_t instead.

size_t??no idea what you are talking about.how would have my
array looked like with size_t? could you please give an example?

size_t is simply an unsigned int. It is 32 bits for a 32 bit compiler and
64 bits for a 64 bit compiler.

size_t mySize = myVector.size().

- Arnie

Thank you

Lucress


.



Relevant Pages

  • Re: large files: when ubiquitous?
    ... >> The fact that undefined behaviour is invoked is an immediate consequence ... If your program complies with the rules of the C standard, ... branches are completely equivalent and both invoke undefined behaviour ... As with every transformation a compiler does, ...
    (comp.os.linux.development.system)
  • Re: Create an Object from an Array Class
    ... I want to invoke a method that takes String[] object as parameter ... this is an array of java.lang.String's). ... create a class of the field type ...
    (comp.lang.java.programmer)
  • Re: Custom keywords and compiler-supplied code
    ... Having to sprinkle GUI code with InvokeRequired tests means the GUI ... I.e. the C# compiler and JIT compiler between them have ... Regarding the runtime handling of a delegate's Invoke method, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Java VM Address Space
    ... By everyone else's definition of the word "compile" Java bytecode is ... A second stage of the compiler ... which mostly resemble the set written in the Java language. ... the four invoke opcodes could be said to ...
    (comp.lang.java.programmer)
  • Re: sizeof operator implementation
    ... sizeofat compile time. ... How does C compiler gets value at ... it definitely invokes UB due to casting 10 to a pointer type; might as well cast 0 and make what you're doing obvious. ... Casting 10 to a pointer type does *not* invoke UB, ...
    (comp.lang.c)

Loading