本文整理汇总了C++中printout函数的典型用法代码示例。如果您正苦于以下问题:C++ printout函数的具体用法?C++ printout怎么用?C++ printout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
char matx1[4][4] = {{'-','-','-','-'}, {'-','o','-','-'}, {'o','o','o','-'}, {'-','-','-','-'}};
char matx2[4][4] = {{'-','-','-','-'}, {'-','o','o','-'}, {'o','o','-','-'}, {'-','-','-','-'}};
char matx3[4][4] = {{'-','-','-','-'}, {'-','o','-','-'}, {'-','o','-','-'}, {'-','o','o','-'}};
char matx4[4][4] = {{'-','-','o','-'}, {'-','-','o','-'}, {'-','-','o','-'}, {'-','-','o','-'}};
printout(matx1, matx2, matx3, matx4);
rotation(matx1);
rotation(matx2);
rotation(matx3);
rotation(matx4);
printout(matx1, matx2, matx3, matx4);
rotation(matx1);
rotation(matx2);
rotation(matx3);
rotation(matx4);
printout(matx1, matx2, matx3, matx4);
rotation(matx1);
rotation(matx2);
rotation(matx3);
rotation(matx4);
printout(matx1, matx2, matx3, matx4);
rotation(matx1);
rotation(matx2);
rotation(matx3);
rotation(matx4);
printout();
return 0;
}
示例2: print_model
void print_model (model *mod) {
int i, j;
printout("Dependent variable: %s\n", mod->dvname);
printlog(VERBOSE, "\tAt position: %d\n", mod->dv);
printout("Number of independent variables: %d\n", mod->numiv);
printlog(VERBOSE, "Space allocated for independent variable array: %d\n", mod->maxiv);
for (i = 0; i < mod->numiv; i++) {
printout("Effect %d: %s", 1+i, mod->ivnames[i]);
if (mod->direct[i] == 1)
printout(" (DIRECT)\n");
else
printout("\n");
printlog(VERBOSE, "\tAt position: %d\n", mod->iv[i]);
}
printout("Number of interactions: %d\n", mod->numints);
printlog(VERBOSE, "Space allocated for interactions: %d\n", mod->maxints);
for (i = 0; i < mod->numints; i++) {
printout("Interaction %d: %s, %d terms [", 1+i, mod->intnames[i], mod->inttc[i]);
for (j = 0; j < mod->inttc[i]; j++) {
printout("%d", mod->ints[i][j]);
if (j < mod->inttc[i] - 1)
printout(", ");
else
printout("]\n");
}
}
}
示例3: printout
void printout(box * tree) {
if((tree) != NULL) {
printout(tree -> l);
printf("%d",tree -> d);
printout(tree -> r);
}
}
示例4: _create_object
template <typename TYPE> TYPE* _create_object(Geant4Kernel& kernel, const TypeName& typ) {
Geant4Context* ctxt = kernel.workerContext();
Geant4Action* object = PluginService::Create<Geant4Action*>(typ.first, ctxt, typ.second);
if (!object && typ.first == typ.second) {
string _t = typeName(typeid(TYPE));
printout(DEBUG, "Geant4Handle", "Object factory for %s not found. Try out %s",
typ.second.c_str(), _t.c_str());
object = PluginService::Create<Geant4Action*>(_t, ctxt, typ.second);
if (!object) {
size_t idx = _t.rfind(':');
if (idx != string::npos)
_t = string(_t.substr(idx + 1));
printout(DEBUG, "Geant4Handle", "Try out object factory for %s",_t.c_str());
object = PluginService::Create<Geant4Action*>(_t, ctxt, typ.second);
}
}
if (object) {
TYPE* ptr = dynamic_cast<TYPE*>(object);
if (ptr) {
return ptr;
}
except("Geant4Handle", "Failed to convert object of type %s to handle of type %s!",
typ.first.c_str(),typ.second.c_str());
}
except("Geant4Handle", "Failed to create object of type %s!", typ.first.c_str());
return 0;
}
示例5: printout
void printout(node *Tree) {
printf("Root = %d\n",Tree->val);
if(Tree->right){
printf("Right: ");
printout(Tree->right);
}
if(Tree->left){
printf("Left: ");
printout(Tree->left);
}
}
示例6: tracenumber
void tracenumber( tsd_t *TSD, const num_descr *num, char type )
{
char tmpch;
streng *message,*tmpstr;
tra_tsd_t *tt;
num_descr nd;
int indent;
tmpch = TSD->currlevel->tracestat;
if ( ( tmpch != 'I' ) && ( tmpch != 'R' ) )
return;
tt = (tra_tsd_t *)TSD->tra_tsd;
if ( tt->traceflag || tt->quiet )
return;
memset( &nd, 0, sizeof( num_descr ) );
descr_copy( TSD, num, &nd );
tmpstr = str_norm( TSD, &nd, NULL );
indent = TSD->systeminfo->cstackcnt + TSD->systeminfo->ctrlcounter;
message = Str_makeTSD( 30 + indent + tmpstr->len );
sprintf( tt->tracestr, " >%%c> %%%ds \"%%.%ds\"",
indent, tmpstr->len );
message->len = sprintf( message->value, tt->tracestr,
type, "", tmpstr->value );
printout( TSD, message );
if ( nd.num != NULL )
FreeTSD( nd.num );
Free_stringTSD( message );
Free_stringTSD( tmpstr );
}
示例7: GetParent
void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
{
SCH_EDIT_FRAME* parent = GetParent();
GetPrintOptions();
wxPrintDialogData printDialogData( parent->GetPageSetupData().GetPrintData() );
printDialogData.SetMaxPage( g_RootSheet->CountSheets() );
if( g_RootSheet->CountSheets() > 1 )
printDialogData.EnablePageNumbers( true );
wxPrinter printer( &printDialogData );
SCH_PRINTOUT printout( parent, _( "Print Schematic" ) );
if( !printer.Print( this, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
wxMessageBox( _( "An error occurred attempting to print the schematic." ),
_( "Printing" ), wxOK );
}
else
{
parent->GetPageSetupData() = printer.GetPrintDialogData().GetPrintData();
}
}
示例8: SetPrintParameters
void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
{
SetPrintParameters( );
// If no layer selected, we have no plot. prompt user if it happens
// because he could think there is a bug in Pcbnew:
if( s_Parameters.m_PrintMaskLayer == 0 )
{
DisplayError( this, _( "No layer selected" ) );
return;
}
wxPrintDialogData printDialogData( *s_PrintData );
wxPrinter printer( &printDialogData );
wxString title = _( "Print" );
BOARD_PRINTOUT_CONTROLLER printout( s_Parameters, m_parent, title );
if( !printer.Print( this, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
DisplayError( this, _( "There was a problem printing" ) );
return;
}
else
{
*s_PrintData = printer.GetPrintDialogData().GetPrintData();
}
}
示例9: tracevalue
void tracevalue( tsd_t *TSD, const streng *str, char type )
{
char tmpch;
streng *message;
tra_tsd_t *tt;
int indent;
/*
* ANSI 8.3.17 requires placeholders in PARSE to be traced with TRACE R
*/
tmpch = TSD->currlevel->tracestat;
if ( ( tmpch != 'I' ) && ( tmpch != 'R' ) )
return;
tt = (tra_tsd_t *)TSD->tra_tsd;
if ( tt->traceflag || tt->quiet )
return;
indent = TSD->systeminfo->cstackcnt + TSD->systeminfo->ctrlcounter;
message = Str_makeTSD( str->len + 30 + indent );
sprintf( tt->tracestr, " >%%c> %%%ds \"%%.%ds\"",
indent, str->len );
message->len = sprintf( message->value, tt->tracestr,
type, "", str->value );
printout( TSD, message );
Free_stringTSD( message );
}
示例10: printDialogData
void DIALOG_PRINT_USING_PRINTER::OnPrintButtonClick( wxCommandEvent& event )
{
if( !PreparePrintPrms() )
return;
wxPrintDialogData printDialogData( *s_printData );
wxPrinter printer( &printDialogData );
wxString title = _( "Print" );
BOARD_PRINTOUT_CONTROLLER printout( s_Parameters, m_Parent, title );
// Disable 'Print' button to prevent issuing another print
// command before the previous one is finished (causes problems on Windows)
ENABLER printBtnDisable( *m_buttonPrint, false );
if( !printer.Print( this, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
DisplayError( this, _( "There was a problem printing" ) );
}
else
{
*s_printData = printer.GetPrintDialogData().GetPrintData();
}
}
示例11: GetParent
bool DIALOG_PRINT_USING_PRINTER::TransferDataFromWindow()
{
SCH_EDIT_FRAME* parent = GetParent();
GetPrintOptions();
wxPrintDialogData printDialogData( parent->GetPageSetupData().GetPrintData() );
printDialogData.SetMaxPage( g_RootSheet->CountSheets() );
if( g_RootSheet->CountSheets() > 1 )
printDialogData.EnablePageNumbers( true );
wxPrinter printer( &printDialogData );
SCH_PRINTOUT printout( parent, _( "Print Schematic" ) );
// Disable 'Print' button to prevent issuing another print
// command before the previous one is finished (causes problems on Windows)
m_sdbSizer1OK->Enable( false );
if( !printer.Print( this, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
wxMessageBox( _( "An error occurred attempting to print the schematic." ),
_( "Printing" ), wxOK );
}
else
{
parent->GetPageSetupData() = printer.GetPrintDialogData().GetPrintData();
}
return true;
}
示例12: main
int main (void)
{
FILE *fin, *fout, *fdict;
char str[MAXCHAR + 1];
Name cow[MAXN];
int count, index;
long long serial;
fin = fopen("namenum.in", "r");
fout = fopen("namenum.out", "w");
fdict = fopen("dict.txt", "r");
count = 0;
while (fscanf(fdict, "%s", str) != EOF) {
if (screen(str))
continue;
copy(&cow[count++], str);
sort(cow, count);
}
fscanf(fin, "%lld", &serial);
if ((index = find(serial, cow, count)) > -1)
printout(fout, index, cow, count);
else
fprintf(fout, "NONE\n");
return 0;
}
示例13: printDialogData
void DIALOG_PRINT_FOR_MODEDIT::OnPrintButtonClick( wxCommandEvent& event )
{
PCB_PLOT_PARAMS plot_opts = m_parent->GetPlotSettings();
s_Parameters.m_Print_Black_and_White = m_ModeColorOption->GetSelection();
s_Parameters.m_PrintScale = s_scaleList[m_ScaleOption->GetSelection()];
plot_opts.SetFineScaleAdjustX( s_Parameters.m_XScaleAdjust );
plot_opts.SetFineScaleAdjustY( s_Parameters.m_YScaleAdjust );
plot_opts.SetScale( s_Parameters.m_PrintScale );
m_parent->SetPlotSettings( plot_opts );
wxPrintDialogData printDialogData( *s_PrintData );
wxPrinter printer( &printDialogData );
BOARD_PRINTOUT_CONTROLLER printout( s_Parameters, m_parent, _( "Print Footprint" ) );
if( !printer.Print( this, &printout, true ) )
{
if( wxPrinter::GetLastError() == wxPRINTER_ERROR )
DisplayError( this, _( "There was a problem printing." ) );
return;
}
else
{
*s_PrintData = printer.GetPrintDialogData().GetPrintData();
}
}
示例14: run_tests
void run_tests(bool empty, uint64_t num, T a1){
uint64_t i = 0;
double ot = timer_overhead(num);
string message;
vector<double> time;
Vector packages;
hpx::naming::id_type lid = hpx::find_here();
create_packages<Vector, Package>(packages, num);
//next test applies actions directly, skipping get_gid stage
high_resolution_timer tt;
for(i = 0; i < num; ++i)
hpx::apply<Action>(lid, a1);
double mean = tt.elapsed()/num;
time.reserve(num);
message = "Measuring time required to apply actions directly:";
for(i = 0; i < num; i++){
high_resolution_timer t1;
hpx::apply<Action>(lid, a1);
time.push_back(t1.elapsed());
}
printout(time, ot, mean, message);
}
示例15: WXUNUSED
void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event))
{
wxPostScriptPrinter printer(g_printData);
MyPrintout printout(_T("My printout"));
printer.Print(this, &printout, true/*prompt*/);
(*g_printData) = printer.GetPrintData();
}