Cannot output display using Std::cout

Source: Internet
Author: User

When you test a line of functions, there is a situation where std::cout cannot be exported, and no reason is found.

1. Start the test from the first line of the main function until you find a function

O_initer.ekf_filter (filter, X_k_k,p_k_k, Sigma_a, Sigma_alpha, Sigma_image_noise, O_INITER.GSVOC);
The function Body contains:

	F = Class (F, ' ekf_filter ');
	if (Freopen ("Tracedeg/trace.txt", "w", stdout) = = NULL)
		fprintf (stderr, "error redirecting stdout\n");
	M_shower. Printmatrix (x_k_k);
	Fclose (stdout);

The Freopen function disrupts the overload, and it's OK to log off.

2.fclose (stdout); Use of statements

Fclose (stdout); Use of the statement causes the file output stream to be relocated back to standard screen output. Need attention.

Modified to File.close ();
File.clear ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.