将结果打印到屏幕 [英] Print Result To Screen

查看:71
本文介绍了将结果打印到屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个控制台应用程序,我需要将此查询的结果打印到屏幕上.
怎么做?

"SELECT COUNT(IP) AS row_count FROM urlock WHERE IP=''173.201.216.2''";

解决方案

使用printf()cout显示根据您的要求格式化的结果.


如果您想要显示查询结果,而不是首先以字符串形式获取此值,然后借助printf和cout可以显示结果.
您可以和我们分享您的数据库部分吗?


这里是printf()的解释以及如何使用它:
http://www.cplusplus.com/reference/clibrary/cstdio/printf/ [ ^ ]


I have a console app and I need to print the result of this query to screen.
How is this done?

"SELECT COUNT(IP) AS row_count FROM urlock WHERE IP=''173.201.216.2''";

解决方案

Use printf() or cout to display your results formatted according to your requirements.


If you want to show the result of query than first you get this value in string and than with the help of printf and cout you can display your results.
Can you please share your database part with us ??


Here''s an explanation on printf() and how to use it:
http://www.cplusplus.com/reference/clibrary/cstdio/printf/[^]


这篇关于将结果打印到屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆