Fedora Linux Support Community & Resources Center
  #1  
Old 19th December 2010, 10:32 PM
sepoto Offline
Registered User
 
Join Date: Dec 2010
Posts: 174
windows_7firefox
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:

0x43143124312

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","127.0.0.1" , "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 10:32 PM.
Reply With Quote
Reply

Tags
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 03: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 09:03 PM
Screen output extremly blurred vortex3k Using Fedora 1 31st January 2007 02:25 PM
Need help! Output video stream to secondary lcd screen spacelobsters Hardware & Laptops 1 28th December 2006 01:09 AM


Current GMT-time: 03:31 (Saturday, 25-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

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
Yilan - Luneville Photos - Hopkinsville