You are here:

C++/------------------------- ...

Advertisement


Question
-------------------------
Followup To
Question -
Hello, need a help. have to calculate a formula in C and print out results. My printer connected to USB port.Win Me, Visual C++,
Answer -
what formula you want to calculate?
The formula is not a big deal Zij=Xi*pow(sin(Yj),3)...and so on, (two dim. array...) but the problem is how to send data (the result)to the printer(using PRINTF() to send streem on to display or file) but to get things printed out .... Thanks a lot.

Answer
Zij=Xi*pow(sin(Yj),3) can be done in C/C++ like:

double temp, Z[10,20], Z[10], Y[20];
...
temp = sin(Y[j]);
Z[i][j] = X[i] * (temp * temp * temp);

you can also use the power function, but the above is easier.

To print, just use normal printf or cout functions that display on screen, but then redirect the output to printer (from command prompt). See below:

C:\> myprog > PRN

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Sam

Expertise

You may ask me about simple to complicated C/C++ programming methods/style and most like questions about network programming in C++.

Experience

I'm a professional programer in C++ and network/internet programming.

©2016 About.com. All rights reserved.