本文整理汇总了C++中putString函数的典型用法代码示例。如果您正苦于以下问题:C++ putString函数的具体用法?C++ putString怎么用?C++ putString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putString函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: intro
void intro(void) {
FILE *in;
char ch;
int i,j;
int vk;
clearScreen();
in = fopen("intro.txt","r");
/* 把檔案�堶悸漲r讀取並顯示出來 */
for(i=0;i<HEIGHT;i++) {
for(j=0;j<WIDTH*2;j++) {
while((ch = fgetc(in)) == '\n' || ch == '|' || ch == '-');
putASCII2(j + OFFSET_X,i + OFFSET_Y,ch,15,0);
}
}
fclose(in);
drawCmdWindow();
/* 當使用者按下 Enter 鍵即離開 */
while(1) {
if(waitForKeyDown(1)) {
vk=getKeyEventVirtual();
if(vk == VK_RETURN)
break;
}
if(i==0)
putString(46+OFFSET_X,18+OFFSET_Y," ",12,0);
else
putString(46+OFFSET_X,18+OFFSET_Y,"想離開請按 Enter ...",12,0);
drawCmdWindow();
i= !i;
}
}
开发者ID:SLMT,项目名称:console-tower-defence,代码行数:34,代码来源:others.c
示例2: point
float UI::getFloatFromCUI(){
uint8_t c = 0;
float fnum = 0;
float dp = 0.1; // dp = decimal point (小数点)
while(1){
c = getChar();
if(c == '\r'){ // Enterキー押下
break;
}
if(c == '.' && checkDotFlag() == false){ // ドット押下
raiseDotFlag();
dp = 0.1;
continue;
}
if(c < '0' || c > '9'){ // 数字0-9,Enter以外
putString("\n\r"); // 改行
fnum = 0; // num をクリア
dropDotFlag();
dp = 0.1;
continue;
}
if( checkDotFlag() == false ){
fnum = fnum * 10 + c - '0';
} else if(dp > DP_LIMIT){
fnum = fnum + (c - '0') * dp;
dp /= 10;
} else{
putString("\b \b"); // BackSpace
}
}
dropDotFlag();
return (fnum);
}
开发者ID:RobonoKimochi,项目名称:EV3,代码行数:33,代码来源:UI.cpp
示例3: while
int16_t UI::getIntegerFromCUI(){
uint16_t c = 0;
uint16_t num = 0;
bool mflag = false; // マイナスフラグ
while(1){
c = getChar();
if(c == '\r'){ // Enterキー押下
break;
}
if(c== '-' && num == 0 && mflag == false){ // この条件では、0入力後のマイナス(ex. 0-25etc...)を除外できない
mflag = true;
continue;
}
if(c < '0' || c > '9'){ // 数字0-9以外
putString("\n\r"); // 改行
num = 0; // num をクリア
mflag = false; // マイナスフラグをクリア
continue;
}
num = num * 10 + ( c - '0');
if( num > 255 || num < -255){
putString("\n\rBeyond the limit\n\r"); // 範囲外
}
}
if(mflag == false){
return (num);
} else{
return ( -1 * num);
}
}
开发者ID:RobonoKimochi,项目名称:EV3,代码行数:30,代码来源:UI.cpp
示例4: putUser
static void putUser(SFLReceiver *receiver, SFLExtended_user *user)
{
putNet32(receiver, user->src_charset);
putString(receiver, &user->src_user);
putNet32(receiver, user->dst_charset);
putString(receiver, &user->dst_user);
}
开发者ID:svn2github,项目名称:host-sflow,代码行数:7,代码来源:sflow_receiver.c
示例5: testStringTable
static void testStringTable(void)
{
int val;
struct StringTable *st;
int i;
for (i = 0; i < 100; i += 1) {
st = newStringTable();
rassert(st);
rassert(findString(st, "dog") == NULL);
rassert(putString(st, "cat", &val) == 0);
rassert(findString(st, "cat") == &val);
rassert(delString(st, "dog") == ERR_NOSTRING);
rassert(delString(st, "cat") == 0);
rassert(findString(st, "cat") == NULL);
rassert(putString(st, "1", &val) == 0);
rassert(putString(st, "2", &val) == 0);
rassert(putString(st, "3", &val) == 0);
allSum = 0;
allStrings(st, allStringTester, NULL);
rassert(allSum == 6);
rassert(delString(st, "1") == 0);
rassert(delString(st, "3") == 0);
rassert(delString(st, "2") == 0);
rassert(putString(st, "memcheck", &val) == 0);
freeStringTable(st);
}
}
开发者ID:BCI-AR,项目名称:NeuroServer,代码行数:27,代码来源:ntest.c
示例6: main
int main(int argc, char *argv[])
{
char stringToPrint[64];
clearScreen();
initNetwork();
sprintf(stringToPrint,"Hallo, dies ist ein Test! !\"$%&/()=?),.-;:_#'`*+~");
putString(stringToPrint,COLOR_RED);
putString(" :-) :-D ",COLOR_GREEN);
putString("Einiges noch zu tun!",COLOR_AMBER);
updateDisplay(client_sock);
sleep(1);
while(1)
{
shiftLeft();
updateDisplay(client_sock);
usleep(20000);
}
close(client_sock);
return 0;
}
开发者ID:initcrash,项目名称:led_matrix_control,代码行数:30,代码来源:main.c
示例7: while
void *runPeriodicTask (void *t){
TaskInfo s; // self reference
Time c = 0; // completion time
Time d = 0; // deadline
s = periodicTaskTable[*(int *)t];
while (systemNotCompleted()){
// Compute the deadline or the next activation
d=nextActivation(s.period);
putHeader (s.name);
putString ("activated");
newLine();
// Simulate the execution of this task using
// computeDuringTimeSpan. Provide the name of the task, its worst
// case execution time, and the period of the task. ATTENTION :
// the period parameter in computeDuringTimeSPan is used to
// compute the execution priority. It returns the completion time
// that should be used to check whether the task missed its
// deadline. Use variable c to save this value. See tasks.h.
// NYI("compute task for its computation time");
//********************************************************
c = computeDuringTimeSpan(s.name, s.computation, s.period);
// NYI("save the completion time in variable c for later use");
//********************************************************
// c = timeAfterTimeSpan(s.computation);
putHeader (s.name);
putString ("completed");
newLine();
// Check that the completion time did not occur after the deadline
if (d < c) {
putHeader (s.name);
putString ("OVERRUN ");
putTime (d);
putString (" < ");
putTime (c);
newLine();
break;
};
// Wait for the next activation. In other words, wait for the deadline.
// NYI("wait for the next activation");
//**********************************************************
delayUntil(d);
}
return NULL;
}
开发者ID:uwevil,项目名称:ASTRE,代码行数:58,代码来源:periodictasks.c
示例8: cmain
void cmain() {
setSysInt();
putString("Hello, world!\n");
while (status) {
putString("$ > ");
parseCommand(getString());
}
putString("Bye\n");
}
开发者ID:CJK-Regan,项目名称:homework,代码行数:9,代码来源:kernel.c
示例9: displayFreq
void displayFreq()
{
command(HOME);
sprintf(temp,"0:%06u 1:%06u",freqValue[0],freqValue[1]);
putString(temp);
putChar(13);
sprintf(temp,"2:%06u 3:%06u",freqValue[2],freqValue[3]);
putString(temp);
putChar(13);
putChar(13);
putString("Frequency");
}
开发者ID:BGCX261,项目名称:ziplockk-embedded-svn-to-git,代码行数:12,代码来源:display.c
示例10: displayTC
void displayTC()
{
command(HOME);
sprintf(temp,"FS:%06u RS:%06u",frontSpeed,rearSpeed);
putString(temp);
putChar(13);
sprintf(temp,"SL:%06u ST:%03u",slip,status);
putString(temp);
putChar(13);
putChar(13);
putString("Traction Control");
}
开发者ID:BGCX261,项目名称:ziplockk-embedded-svn-to-git,代码行数:12,代码来源:display.c
示例11: displayAnalogue
void displayAnalogue()
{
command(HOME);
sprintf(temp,"0:%04d 1:%04d 2:%04d",adcValues[0],adcValues[1],adcValues[2]);
putString(temp);
//putChar(13);
sprintf(temp,"3:%04d 4:%04d 5:%04d",adcValues[3],adcValues[4],adcValues[5]);
putString(temp);
//putChar(13);
sprintf(temp,"6:%04d 7:%04d",adcValues[6],adcValues[7]);
putString(temp);
putChar(13);
putString("Analogue");
}
开发者ID:BGCX261,项目名称:ziplockk-embedded-svn-to-git,代码行数:14,代码来源:display.c
示例12: exec_Var
static void exec_Var(void * A)
{
void * C;
struct Var * N;
void (*f) (void);
N = (struct Var*) A;
/* printf("executeVar %s %d !!\n",N->l, N->t);*/
switch(N->t) {
case VT_B :
putBool(N->b);
break;
case VT_C :
putString((char*)N->a);
break;
case VT_N :
if (nbOnStack(N->a) > 0) {
C = duplicateNum(N->a,1);
N->a = C;
}
putVar(N->a);
break;
case VT_L :
f = (PFV)(N->a);
f();
break;
case VT_F :
execFctV(N->a);
break;
default : /* VT_I */
break;
}
}
开发者ID:Kegeruneku,项目名称:nife,代码行数:32,代码来源:stackV.c
示例13: lenString
//
// Info::putChunkMIMP
//
void Info::putChunkMIMP()
{
if(!numChunkMIMP) return;
Core::Array<IR::Object const *> imps{numChunkMIMP};
auto itr = imps.begin();
for(auto const &obj : prog->rangeObject())
{
if(!obj.defin && obj.space.base == IR::AddrBase::MapReg)
*itr++ = &obj;
}
Core::FastU size = numChunkMIMP * 4;
for(auto const &imp : imps)
size += lenString(imp->glyph);
putData("MIMP", 4);
putWord(size);
for(auto const &imp : imps)
{
putWord(imp->value);
putString(imp->glyph);
}
}
开发者ID:MP2E,项目名称:GDCC,代码行数:29,代码来源:putChunk.cpp
示例14: putString
bool BasePersistenceManager::transfer(const char *name, AnsiStringArray &val) {
size_t size;
if (_saving) {
size = val.size();
_saveStream->writeUint32LE(size);
for (AnsiStringArray::iterator it = val.begin(); it != val.end(); ++it) {
putString((*it).c_str());
}
} else {
val.clear();
size = _loadStream->readUint32LE();
for (size_t i = 0; i < size; i++) {
char *str = getString();
if (_loadStream->err()) {
delete[] str;
return STATUS_FAILED;
}
if (str) {
val.push_back(str);
}
delete[] str;
}
}
return STATUS_OK;
}
开发者ID:mokerjoke,项目名称:scummvm,代码行数:29,代码来源:base_persistence_manager.cpp
示例15: wait_busy
void USART::printf_length(const char *str,uint16_t length)
{
#if (USE_DMA == 1)
uint16_t i = 0;
uint16_t tmp_length;
tmp_length = length;
wait_busy();
while(tmp_length--)
{
send_buf[i++] = *str++;
};
DMA_DeInit(_DMA1_Channelx); //将DMA的通道1寄存器重设为缺省值
_DMA1_Channelx->CPAR = (u32)&_USARTx->DR; //外设地址
_DMA1_Channelx->CMAR = (u32) send_buf; //mem地址
_DMA1_Channelx->CNDTR = length ; //传输长度
_DMA1_Channelx->CCR = (0 << 14) | // 非存储器到存储器模式
(2 << 12) | // 通道优先级高
(0 << 11) | // 存储器数据宽度8bit
(0 << 10) | // 存储器数据宽度8bit
(0 << 9) | // 外设数据宽度8bit
(0 << 8) | // 外设数据宽度8bit
(1 << 7) | // 存储器地址增量模式
(0 << 6) | // 外设地址增量模式(不增)
(0 << 5) | // 非循环模式
(1 << 4) | // 从存储器读
(1 << 3) | // 是否允许传输错误中断
(0 << 2) | // 是否允许半传输中断
(0 << 1) | // 是否允许传输完成中断
(1); // 通道开启
#else
putString(str,length);
#endif
}
开发者ID:shentqlf,项目名称:SC-234,代码行数:35,代码来源:uart.cpp
示例16: sendStrings
void sendStrings(jvmtiEnv *jvmti_env, vector<string> stringsToSend)
{
vector<string>::iterator it;
jvmti_env->RawMonitorEnter(monitorSocket);
for (it = stringsToSend.begin(); it < stringsToSend.end(); it++)
putString(&socket_inst, *it);
jvmti_env->RawMonitorExit(monitorSocket);
}
开发者ID:palas,项目名称:james,代码行数:8,代码来源:sock.cpp
示例17: too_long
void TestSerialization::testStringLengthLimits()
{
std::vector<u8> buf;
std::string too_long(STRING_MAX_LEN + 1, 'A');
std::string way_too_large(LONG_STRING_MAX_LEN + 1, 'B');
std::wstring too_long_wide(WIDE_STRING_MAX_LEN + 1, L'C');
EXCEPTION_CHECK(SerializationError, putString(&buf, too_long));
putLongString(&buf, too_long);
too_long.resize(too_long.size() - 1);
putString(&buf, too_long);
EXCEPTION_CHECK(SerializationError, putWideString(&buf, too_long_wide));
too_long_wide.resize(too_long_wide.size() - 1);
putWideString(&buf, too_long_wide);
}
开发者ID:MultiCraftProject,项目名称:MultiCraft,代码行数:17,代码来源:test_serialization.cpp
示例18: URI
void Parcel::putBinder(const sp<IBinder>& base, const sp<IBinder>& binder) {
try {
sp<URI> descriptor = new URI(binder->getInterfaceDescriptor());
sp<URI> uri = new URI(base->getUri()->getScheme(), binder->getUri()->getAuthority(), String::format("/if=%s", descriptor->getPath()->substring(1)->c_str()), descriptor->getQuery(), nullptr);
putString(uri->toString());
} catch (const URISyntaxException& e) {
throw RemoteException(e);
}
}
开发者ID:Himmele,项目名称:Mindroid.cpp,代码行数:9,代码来源:Parcel.cpp
示例19: rankList
void rankList(void)
{
FILE *in;
char name[100];
char toString[100];
int score;
int i=1;
int vk;
clearScreen();
in = fopen("ranklist.slmt","r");
putString(24+OFFSET_X,1+OFFSET_Y,"排 行 榜",11,5);
while(fscanf(in,"%d,%s",&score,name) == 2) {
sprintf(toString,"%d. %7d",i,score);
putString(14+OFFSET_X,i*2+1+OFFSET_Y,toString,15,0);
putString(44+OFFSET_X,i*2+1+OFFSET_Y,name,15,0);
i++;
}
fclose(in);
drawCmdWindow();
/* 當使用者按下 Enter 鍵即離開 */
while(1) {
if(waitForKeyDown(1)) {
vk=getKeyEventVirtual();
if(vk == VK_RETURN)
break;
}
if(i==0)
putString(46+OFFSET_X,18+OFFSET_Y," ",12,0);
else
putString(46+OFFSET_X,18+OFFSET_Y,"想離開請按 Enter ...",12,0);
drawCmdWindow();
i= !i;
}
}
开发者ID:SLMT,项目名称:console-tower-defence,代码行数:42,代码来源:others.c
示例20: main
int main() {
// Setup and enable the secure mode TLB
// Note: Processor starts out in secure mode
setupTranslationTable();
enableTLB();
printf ("\n*** Writing to uart from Secure Mode\n");
putString("Hello from secure mode!\n");
printf ("\n*** Entering Non-Secure Mode\n");
enterNonSecure();
// Enable the non-secure TLB (uses same translation table as secure mode)
enableTLB();
printf ("\n*** Writing to uart from Non-Secure Mode\n");
putString("Hello from non-secure mode!\n");
}
开发者ID:jiangxilong,项目名称:huawei_workspace,代码行数:20,代码来源:application.c
注:本文中的putString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论