社区
单片机/工控
帖子详情
单片机error C183: unmodifiable lvalue
云荒只如初见
2012-12-30 09:12:27
union
{ unsigned int i;
float f;
}humi_val,temp_val; //定义两个共同体,一个用于湿度,一个用于温度
disp[0]=&humi_val.f%16;
disp[1]=&humi_val.f/16;
这个怎么修改啊?
...全文
1479
4
打赏
收藏
单片机error C183: unmodifiable lvalue
union { unsigned int i; float f; }humi_val,temp_val; //定义两个共同体,一个用于湿度,一个用于温度 disp[0]=&humi_val.f%16; disp[1]=&humi_val.f/16; 这个怎么修改啊?
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
shinerise
2012-12-31
打赏
举报
回复
为什么用存储地址去%16?另外浮点数取余的结果是什么?还从来没试过。
AnYidan
2012-12-31
打赏
举报
回复
引用 2 楼 woshi_ziyu 的回复:
浮点数求余要用库函数fmod,在math.h里面
++ 但任何数据类型的地址都是 int
Yingyingzi000
2012-12-31
打赏
举报
回复
单片机,至少keil不支持单精度float,只能用double。 小吐一下槽,double的运算是相当费CPU的。 还有,取余以后要转化整数 例如:disp[0]=(int)(humi_val.f%16); 前面加&取地址实在是不知道你想干什么……
woshi_ziyu
2012-12-31
打赏
举报
回复
浮点数求余要用库函数fmod,在math.h里面
关于C语言中类型限定符const的研究.pdf
关于C语言中类型限定符const的研究.pdf
struts_2.3.12GA_API文档(chm版本)
-------------------------------------------------------------------------------- 概述 软件包 类 使用 树 已过时 索引 帮助 上一个类 下一个类 框架 无框架 所有类 摘要: 嵌套 | 字段 | 构造方法 | 方法 详细信息: 字段 | 构造方法 | 方法 -------------------------------------------------------------------------------- com.opensymphony.xwork2 类 ActionSupport java.lang.Object 继承者 com.opensymphony.xwork2.ActionSupport 所有已实现的接口: Action, LocaleProvider, TextProvider, Validateable, ValidationAware, Serializable 直接已知子类: DefaultActionSupport -------------------------------------------------------------------------------- public class ActionSupportextends Objectimplements Action, Validateable, ValidationAware, TextProvider, LocaleProvider, SerializableProvides a default implementation for the most common actions. See the documentation for all the interfaces this class implements for more detailed information. 另请参见: 序列化表格 -------------------------------------------------------------------------------- 字段摘要 从接口 com.opensymphony.xwork2.Action 继承的字段
ERROR
, INPUT, LOGIN, NONE, SUCCESS 构造方法摘要 ActionSupport() 方法摘要 void addAction
Error
(String an
Error
Message) Add an Action-level
error
message to this Action. void addActionMessage(String aMessage) Add an Action-level message to this Action. void addField
Error
(String fieldName, String
error
Message) Add an
error
message for a given field. void clearAction
Error
s() Clears action
error
s. void clear
Error
s() Clears all
error
s. void clear
Error
sAndMessages() Clears all
error
s and messages. void clearField
Error
s() Clears field
error
s. void clearMessages() Clears messages. Object clone() String doDefault() String execute() A default implementation that does nothing an returns "success". Collection
getAction
Error
s() Get the Collection of Action-level
error
messages for this action. Collection
getActionMessages() Get the Collection of Action-level messages for this action. Collection
get
Error
Messages() 已过时。 Use getAction
Error
s(). Map
> get
Error
s() 已过时。 Use getField
Error
s(). Map
> getField
Error
s() Get the field specific
error
s associated with this action. String getFormatted(String key, String expr) Dedicated method to support I10N and conversion
error
s Locale getLocale() Gets the provided locale. String getText(String aTextName) Gets a message based on a message key, or null if no message is found. String getText(String aTextName, List<?> args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. String getText(String aTextName, String defaultValue) Gets a message based on a key, or, if the message is not found, a supplied default value is returned. String getText(String key, String[] args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. String getText(String aTextName, String defaultValue, List<?> args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String key, String defaultValue, List<?> args, ValueStack stack) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String aTextName, String defaultValue, String obj) Gets a message based on a key using the supplied obj, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String key, String defaultValue, String[] args) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. String getText(String key, String defaultValue, String[] args, ValueStack stack) Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. ResourceBundle getTexts() Get the resource bundle associated with the implementing class (usually an action). ResourceBundle getTexts(String aBundleName) Get the named bundle, such as "com/acme/Foo". boolean hasAction
Error
s() Check whether there are any Action-level
error
messages. boolean hasActionMessages() Checks whether there are any Action-level messages. boolean has
Error
s() Checks whether there are any action
error
s or field
error
s. boolean hasField
Error
s() Check whether there are any field
error
s associated with this action. boolean hasKey(String key) Checks if a message key exists. String input() void pause(String result) Stops the action invocation immediately (by throwing a PauseException) and causes the action invocation to return the specified result, such as Action.SUCCESS, Action.INPUT, etc. void setAction
Error
s(Collection
error
Messages) Set the Collection of Action-level String
error
messages. void setActionMessages(Collection
messages) Set the Collection of Action-level String messages (not
error
s). void setContainer(Container container) void setField
Error
s(Map
>
error
Map) Set the field
error
map of fieldname (String) to Collection of String
error
messages. void validate() A default implementation that validates nothing. 从类 java.lang.Object 继承的方法 equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 构造方法详细信息 ActionSupport public ActionSupport()方法详细信息 setAction
Error
s public void setAction
Error
s(Collection
error
Messages)从接口 ValidationAware 复制的描述 Set the Collection of Action-level String
error
messages. 指定者: 接口 ValidationAware 中的 setAction
Error
s 参数:
error
Messages - Collection of String
error
messages -------------------------------------------------------------------------------- getAction
Error
s public Collection
getAction
Error
s()从接口 ValidationAware 复制的描述 Get the Collection of Action-level
error
messages for this action.
Error
messages should not be added directly here, as implementations are free to return a new Collection or an
Unmodifiable
Collection. 指定者: 接口 ValidationAware 中的 getAction
Error
s 返回: Collection of String
error
messages -------------------------------------------------------------------------------- setActionMessages public void setActionMessages(Collection
messages)从接口 ValidationAware 复制的描述 Set the Collection of Action-level String messages (not
error
s). 指定者: 接口 ValidationAware 中的 setActionMessages 参数: messages - Collection of String messages (not
error
s). -------------------------------------------------------------------------------- getActionMessages public Collection
getActionMessages()从接口 ValidationAware 复制的描述 Get the Collection of Action-level messages for this action. Messages should not be added directly here, as implementations are free to return a new Collection or an
Unmodifiable
Collection. 指定者: 接口 ValidationAware 中的 getActionMessages 返回: Collection of String messages -------------------------------------------------------------------------------- get
Error
Messages @Deprecated public Collection
get
Error
Messages()已过时。 Use getAction
Error
s(). -------------------------------------------------------------------------------- get
Error
s @Deprecated public Map
> get
Error
s()已过时。 Use getField
Error
s(). -------------------------------------------------------------------------------- setField
Error
s public void setField
Error
s(Map
>
error
Map)从接口 ValidationAware 复制的描述 Set the field
error
map of fieldname (String) to Collection of String
error
messages. 指定者: 接口 ValidationAware 中的 setField
Error
s 参数:
error
Map - field
error
map -------------------------------------------------------------------------------- getField
Error
s public Map
> getField
Error
s()从接口 ValidationAware 复制的描述 Get the field specific
error
s associated with this action.
Error
messages should not be added directly here, as implementations are free to return a new Collection or an
Unmodifiable
Collection. 指定者: 接口 ValidationAware 中的 getField
Error
s 返回: Map with
error
s mapped from fieldname (String) to Collection of String
error
messages -------------------------------------------------------------------------------- getLocale public Locale getLocale()从接口 LocaleProvider 复制的描述 Gets the provided locale. 指定者: 接口 LocaleProvider 中的 getLocale 返回: the locale. -------------------------------------------------------------------------------- hasKey public boolean hasKey(String key)从接口 TextProvider 复制的描述 Checks if a message key exists. 指定者: 接口 TextProvider 中的 hasKey 参数: key - message key to check for 返回: boolean true if key exists, false otherwise. -------------------------------------------------------------------------------- getText public String getText(String aTextName)从接口 TextProvider 复制的描述 Gets a message based on a message key, or null if no message is found. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for 返回: the message as found in the resource bundle, or null if none is found. -------------------------------------------------------------------------------- getText public String getText(String aTextName, String defaultValue)从接口 TextProvider 复制的描述 Gets a message based on a key, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String aTextName, String defaultValue, String obj)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied obj, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found obj - obj to be used in a MessageFormat message 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String aTextName, List<?> args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for args - a list args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or null if none is found. -------------------------------------------------------------------------------- getText public String getText(String key, String[] args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or null if no message is found. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for args - an array args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or null if none is found. -------------------------------------------------------------------------------- getText public String getText(String aTextName, String defaultValue, List<?> args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: aTextName - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - a list args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String key, String defaultValue, String[] args)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - an array args to be used in a MessageFormat message 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String key, String defaultValue, List<?> args, ValueStack stack)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. Instead of using the value stack in the ActionContext this version of the getText() method uses the provided value stack. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - a list args to be used in a MessageFormat message stack - the value stack to use for finding the text 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getText public String getText(String key, String defaultValue, String[] args, ValueStack stack)从接口 TextProvider 复制的描述 Gets a message based on a key using the supplied args, as defined in MessageFormat, or, if the message is not found, a supplied default value is returned. Instead of using the value stack in the ActionContext this version of the getText() method uses the provided value stack. 指定者: 接口 TextProvider 中的 getText 参数: key - the resource bundle key that is to be searched for defaultValue - the default value which will be returned if no message is found args - an array args to be used in a MessageFormat message stack - the value stack to use for finding the text 返回: the message as found in the resource bundle, or defaultValue if none is found -------------------------------------------------------------------------------- getFormatted public String getFormatted(String key, String expr)Dedicated method to support I10N and conversion
error
s 参数: key - message which contains formatting string expr - that should be formatted 返回: formatted expr with format specified by key -------------------------------------------------------------------------------- getTexts public ResourceBundle getTexts()从接口 TextProvider 复制的描述 Get the resource bundle associated with the implementing class (usually an action). 指定者: 接口 TextProvider 中的 getTexts 返回: the bundle -------------------------------------------------------------------------------- getTexts public ResourceBundle getTexts(String aBundleName)从接口 TextProvider 复制的描述 Get the named bundle, such as "com/acme/Foo". 指定者: 接口 TextProvider 中的 getTexts 参数: aBundleName - the name of the resource bundle, such as "com/acme/Foo". 返回: the bundle -------------------------------------------------------------------------------- addAction
Error
public void addAction
Error
(String an
Error
Message)从接口 ValidationAware 复制的描述 Add an Action-level
error
message to this Action. 指定者: 接口 ValidationAware 中的 addAction
Error
参数: an
Error
Message - the
error
message -------------------------------------------------------------------------------- addActionMessage public void addActionMessage(String aMessage)从接口 ValidationAware 复制的描述 Add an Action-level message to this Action. 指定者: 接口 ValidationAware 中的 addActionMessage 参数: aMessage - the message -------------------------------------------------------------------------------- addField
Error
public void addField
Error
(String fieldName, String
error
Message)从接口 ValidationAware 复制的描述 Add an
error
message for a given field. 指定者: 接口 ValidationAware 中的 addField
Error
参数: fieldName - name of field
error
Message - the
error
message -------------------------------------------------------------------------------- input public String input() throws Exception抛出: Exception -------------------------------------------------------------------------------- doDefault public String doDefault() throws Exception抛出: Exception -------------------------------------------------------------------------------- execute public String execute() throws ExceptionA default implementation that does nothing an returns "success". Subclasses should override this method to provide their business logic. See also Action.execute(). 指定者: 接口 Action 中的 execute 返回: returns Action.SUCCESS 抛出: Exception - can be thrown by subclasses. -------------------------------------------------------------------------------- hasAction
Error
s public boolean hasAction
Error
s()从接口 ValidationAware 复制的描述 Check whether there are any Action-level
error
messages. 指定者: 接口 ValidationAware 中的 hasAction
Error
s 返回: true if any Action-level
error
messages have been registered -------------------------------------------------------------------------------- hasActionMessages public boolean hasActionMessages()从接口 ValidationAware 复制的描述 Checks whether there are any Action-level messages. 指定者: 接口 ValidationAware 中的 hasActionMessages 返回: true if any Action-level messages have been registered -------------------------------------------------------------------------------- has
Error
s public boolean has
Error
s()从接口 ValidationAware 复制的描述 Checks whether there are any action
error
s or field
error
s. Note: that this does not have the same meaning as in WW 1.x. 指定者: 接口 ValidationAware 中的 has
Error
s 返回: (hasAction
Error
s() || hasField
Error
s()) -------------------------------------------------------------------------------- hasField
Error
s public boolean hasField
Error
s()从接口 ValidationAware 复制的描述 Check whether there are any field
error
s associated with this action. 指定者: 接口 ValidationAware 中的 hasField
Error
s 返回: whether there are any field
error
s -------------------------------------------------------------------------------- clearField
Error
s public void clearField
Error
s()Clears field
error
s. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clearAction
Error
s public void clearAction
Error
s()Clears action
error
s. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clearMessages public void clearMessages()Clears messages. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clear
Error
s public void clear
Error
s()Clears all
error
s. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- clear
Error
sAndMessages public void clear
Error
sAndMessages()Clears all
error
s and messages. Useful for Continuations and other situations where you might want to clear parts of the state on the same action. -------------------------------------------------------------------------------- validate public void validate()A default implementation that validates nothing. Subclasses should override this method to provide validations. 指定者: 接口 Validateable 中的 validate -------------------------------------------------------------------------------- clone public Object clone() throws CloneNotSupportedException覆盖: 类 Object 中的 clone 抛出: CloneNotSupportedException -------------------------------------------------------------------------------- pause public void pause(String result)Stops the action invocation immediately (by throwing a PauseException) and causes the action invocation to return the specified result, such as Action.SUCCESS, Action.INPUT, etc. The next time this action is invoked (and using the same continuation ID), the method will resume immediately after where this method was called, with the entire call stack in the execute method restored. Note: this method can only be called within the execute() method. 参数: result - the result to return - the same type of return value in the execute() method. -------------------------------------------------------------------------------- setContainer public void setContainer(Container container) -------------------------------------------------------------------------------- 概述 软件包 类 使用 树 已过时 索引 帮助 上一个类 下一个类 框架 无框架 所有类 摘要: 嵌套 | 字段 | 构造方法 | 方法 详细信息: 字段 | 构造方法 | 方法 --------------------------------------------------------------------------------
有关Java编程方面的几点解惑
How well do you really know Java? Are you a code sleuth? Have you ever spent days chasing a bug caused by a trap or pitfall in Java or its libraries? Do you like brainteasers? Then this is the book for you!
findbugs:may expose internal representation by returning
NULL 博文链接:https://futeng.iteye.com/blog/1833449
Java_集合框架_课件
Java_集合框架_课件
单片机/工控
27,508
社区成员
28,796
社区内容
发帖
与我相关
我的任务
单片机/工控
硬件/嵌入开发 单片机/工控
复制链接
扫一扫
分享
社区描述
硬件/嵌入开发 单片机/工控
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章