Fedora Linux Support Community & Resources Center
Old 19th December 2010, 11:32 PM
sepoto Offline
Registered User
Join Date: Dec 2010
Posts: 174
Output a stream to the screen?

Here's some code below. I want to spit out 'query' to the screen so I can check it. I don't have a fancy debugger installed yet like I am used to using on Windows7. Nor am I familiar with Linux programming very well yet. That's why I ask so many questions:

int outputToImport(const char* tbl_name, const char* output, mysqlpp:onnection* pconn) {
std::ostringstream query;
query << "TRUNCATE TABLE " << tbl_name;
printf(query);<----- ????????????????????????

I just tried
std::cout << query << std::endl;

and got:


I also tried this:

some hex output to my screen. That's not it.

---------- Post added at 10:32 PM ---------- Previous post was at 09:53 PM ----------

I also tried this and get a segmentation fault:

#include </usr/include/mysql++/mysql++.h>
#include <stdio.h>
#include <iostream>
#include <sstream>
#include <string.h>
using namespace std;

int outputToImport(const char* tbl_name, const char* output, mysqlpp:onnection* pconn) {
char* query;
strcpy(query,"TRUNCATE TABLE ");
std::cout << query << std::endl;

int main()
mysqlpp:onnection conn(false);

if (conn.connect("dsgsports","" , "root", "")) {
printf("Connected to database.\n");
else {
printf("Failed to connect to database.");
return 1;
outputToImport("aa","aa", &conn);
return 0;

Last edited by sepoto; 19th December 2010 at 11:32 PM.
Reply With Quote

output, screen, stream

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suppress error output to screen or fix a problem? PabloTwo Using Fedora 2 4th December 2009 04:00 AM
yum install screen output stefan1975 Alpha, Beta & Snapshots Discussions (Fedora 11 Only) 2 18th April 2009 09:07 PM
Direct YUM output to screen and file simultaneously? hozzies Using Fedora 6 8th February 2008 10:03 PM
Screen output extremly blurred vortex3k Using Fedora 1 31st January 2007 03:25 PM
Need help! Output video stream to secondary lcd screen spacelobsters Hardware & Laptops 1 28th December 2006 02:09 AM

Current GMT-time: 06:57 (Thursday, 21-09-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat