错误:“表达式必须具有整数或枚举类型" [英] error : "expression must have integral or enum type"

查看:832
本文介绍了错误:“表达式必须具有整数或枚举类型"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到错误,因为str1变量中的表达式必须具有整数或枚举类型".请帮帮我.

I get error as "expression must have integral or enum type" in str1 variable. Please help me.

extern "C" __declspec(dllexport) LPCTSTR PassValue(LPTSTR str1)
{
   return str1;
}

推荐答案

您将返回在函数定义中定义的另一种类型的字符串.

请查看有关不同类型的字符串的本文(有关概述,请参见末尾的表):
C ++字符串完整指南,第一部分- Win32字符编码 [
You are returning a different type of string that is defined in your function definition.

Look at this article about the different types of strings (see the table at the end for an overview):
The Complete Guide to C++ Strings, Part I - Win32 Character Encodings[^]


这篇关于错误:“表达式必须具有整数或枚举类型"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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