简体   繁体   English

Visual Studio上的C或C ++

[英]c or c++ on visual studio

i ma using visual c++ for my dictionary project ..... but visual c++ hangs on compilation ....while this same code runs well on Linux mint.... i am using visual studio for that i want to give my code GUI form.... here's my code 我可能在我的词典项目中使用Visual c ++ .....但是Visual c ++挂在了编译....而同一代码在Linux Mint上运行良好....我正在使用Visual Studio,我想给出我的代码GUI形式...这是我的代码

///////////////////////////////////////////
#include<stdio.h> 
int upper[30],lower[30],indno=0,row=0,col=-1;

char *p[]={"a",
"एक, अंग्रेजी वर्णमाला का प्रथम अक्षर तथा स्वर,( तर्क मे) पहला कल्पित पुरुष वा प्रस्ताव",
"aback",
"अचानक, एकाएक,पीछे",
"abandon",
"छोड देना, त्याग देना, त्यागना, तजना,बिना आज्ञा नौकरी छोडना, अपने को( दुराचार आदि में) छोड देना, दे देना",
"abandoned",
"छोडा हुआ, निर्जन( स्थान) ,बिगडा हुआ, इन्द्रिय लोलुप, लम्पट, दुराचारी, आवारा",
"abandonment",
"पूर्ण त्याग, सम्पूर्ण आत्मोत्सर्ग, बिल्कुल छोड देना",
//.
//.
//.
//. ///////////////remaining 15000 words and meaning
//.
//.
//. 
};

void main()
{

 }

Collecting from my comments (as confirmed by the OP): You are using hindi strings in your program which may not be supported by your current encoding. 从我的评论中收集(由OP确认):您正在程序中使用印地语字符串,当前的编码可能不支持印地语字符串。 You can convert all char strings to wide char strings (unicode) by prepending an L to strings and change the type of strings from char * to wchar_t * . 您可以通过在字符串前面加L并将所有字符串类型从char *更改为wchar_t *来将所有char字符串转换为宽char字符串(unicode)。

If this change works for you, you would need more changes like: 如果此更改对您有用,则您将需要更多更改,例如:

strlen -> wcslen strlen-> wcslen
%s -> %ls (in print) %s->%ls(打印中)
printf -> wprintf (Optional) printf-> wprintf(可选)

#include <stdio.h>
#include <wchar.h>
#include <locale.h>

wchar_t *p[]={L"a",
              L"एक, अंग्रेजी वर्णमाला का प्रथम अक्षर तथा स्वर,( तर्क मे) पहला कल्पित पुरुष वा प्रस्ताव",
              L"aback",
              L"अचानक, एकाएक,पीछे",
};

int main()
{
  setlocale(LC_CTYPE, "en_IN");
  wprintf(L"%ls -> %ls\n", p[0], p[1]);
  wprintf(L"%ls -> %ls\n", p[2], p[3]);
  return 0;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM