小编Joh*_*hnH的帖子

串口写入和读取窗口无法正常工作


我首先尝试使用javax.comm连接到串口(COM4).它甚至没有打开串口.

然后我尝试使用rxtx库(rxtx-2.2pre2)进行连接.它连接和写入数据但不从串行端口读取任何数据.

是否有任何JDK /平台依赖项使用javax.comm或rxtx库?

我使用:
的Windows XP SP3,
JDK 1.6.0_22,
RXTX-2.2pre2,
USB转串口适配器,
Portmon(微软) -监控串口的活动
超级终端-检查COM端口确实有效.
http://goo.gl/mNLNE - 用于检查读写的示例代码

如果您遇到类似我的类似问题,请告诉我.

任何帮助表示赞赏!

谢谢,J

java windows serial-port rxtx javax.comm

7
推荐指数
1
解决办法
2045
查看次数

链表头双指针传递

我在一些书/教程中看到过这个。

当您将(链表的)头指针传递给函数时,您需要将其作为双指针传递。

例如: // 这是反向链表,其中 head 指向第一个节点。

void nReverse(digit **head)
{
    digit *prev=NULL;
    digit *curr=*head;
    digit *next;

    while(curr!=NULL)
    {
        next=curr->next;
        curr->next=prev;
        prev=curr;
        curr=next;
    }
    *head=prev;
    return;
}
Run Code Online (Sandbox Code Playgroud)

这工作正常。

当我使用单指针时它也有效,

void nReverse(digit *head)
{
    digit *prev=NULL;
    digit *curr=head;
    digit *next;

    while(curr!=NULL)
    {
        next=curr->next;
        curr->next=prev;
        prev=curr;
        curr=next;
    }
    head=prev;
    return;
}
Run Code Online (Sandbox Code Playgroud)

我尝试使用头指针打印列表。这两个功能都可以正常工作。

我错过了什么吗?

谢谢,

c c++ reverse linked-list double-pointer

3
推荐指数
1
解决办法
6111
查看次数

Java接口类型基本问题

我有一个Java接口的基本问题.

如果我有一个interface IAinterface IB extends IA

现在,

class CK implements IB,
class CL implements IB,
class CM implements IB,
Run Code Online (Sandbox Code Playgroud)

......等

void foo(IA iFace) {
// I know how to check if iFace is of type CK/CL/CM ...

// Is it possible to check if iFace is of type IB ?

}
Run Code Online (Sandbox Code Playgroud)

希望我的问题很明确.

谢谢你的回复.

java inheritance interface

0
推荐指数
1
解决办法
480
查看次数