小编Der*_*son的帖子

确定Windows窗体应用程序中的插入模式

我想检查C#Windows窗体应用程序中的Insert键的状态.这是最小的代码(不起作用;带有两个RadioButtons的表单):

using System;
using System.Windows.Forms;

using System.Windows.Input;
// Also added PresentationCore and WindowsBase refereneces

namespace InsertModeDemo1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (Keyboard.IsKeyToggled(Key.Insert))
                radioButtonInsert.Checked = true;
            else
                radioButtonOverstrike.Checked = true;
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

c# winforms

2
推荐指数
1
解决办法
1032
查看次数

C 将指针传递给数组中的结构体时出现问题

我正在将一个程序从 Pascal 翻译成 C。我已经很多年没有使用 C 语言了。这是相关的代码片段:

typedef struct querec *queptr;
struct querec {
    char item;
    queptr next;
};
struct queue {
    queptr front,
    rear;
};
struct queue qnum[5];
char item;

const char remove(struct queue *q)
{
    queptr p;
    char remove_result;

    p = q->front;
    remove_result = p->item;
    q->front = p->next;
    if (q->front == NULL)
        q->rear = NULL;
    return remove_result;
}

main()
{
    ...
    item = remove(&qnum[3]);
}
Run Code Online (Sandbox Code Playgroud)

它不会在 Visual Studio 2015 中编译,报告以下内容:

Warning C4133   'function': incompatible types - from 'queue *' …
Run Code Online (Sandbox Code Playgroud)

c arrays struct pointers

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

标签 统计

arrays ×1

c ×1

c# ×1

pointers ×1

struct ×1

winforms ×1