小编Chr*_*ook的帖子

数据类型不匹配和冲突编译器

我正在一个名为TutorialsPoint的网站上学习C编程语言的基本概念.本网站上的源代码示例可以包含一个"试一试"按钮,该按钮可以使用在线c编译器(GNU GCC版本4.7.2)打开在线c编程环境.在一个示例中,演示了sizeof()函数.这是源代码.

#include <stdio.h>
#include <limits.h>

int main() {

  printf("Storage size for int : %d \n", sizeof(int));

  return 0;
}
Run Code Online (Sandbox Code Playgroud)

链接到课程:TutorialsPoint - C数据类型

在在线编程环境中编译和执行此程序时,将生成以下输出:

"Storage size for int : 4"
Run Code Online (Sandbox Code Playgroud)

当我尝试使用GNU GCC版本5.2.1在我的计算机上编译相同的代码时,收到以下错误消息:

gcc sizeofExample.c
sizeofExample.c: In function 'main':
sizeofExample.c:6:10: warning: format '%d' expects argument of type 'int',
but argument 2 has type 'long unsigned int' [-Wformat=]
  printf("Storage size for int: %d \n", sizeof(int));
         ^
Run Code Online (Sandbox Code Playgroud)

这是我的源代码,只是为了彻底:

#include <stdio.h>
#include <limits.h>

int main()
{
  printf("Storage size for int : %d \n", …
Run Code Online (Sandbox Code Playgroud)

c printf sizeof

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

未找到 GnuCOBOL 入口点

我已经在我的 Ubuntu 17.04 系统上安装了 GnuCOBOL 2.2。我已经编写了一个基本的 hello world 程序来测试编译器。

1       IDENTIFICATION DIVISION.
2       PROGRAM-ID. HELLO-WORLD.
3      *---------------------------
4       DATA DIVISION.
5      *---------------------------
6       PROCEDURE DIVISION.
7           DISPLAY 'Hello, world!'.
8           STOP RUN.
Run Code Online (Sandbox Code Playgroud)

该程序名为HelloWorld.cbl。当我用命令编译程序时

cobc HelloWorld.cbl
Run Code Online (Sandbox Code Playgroud)

HelloWorld.so 产生。当我尝试使用运行编译的程序时

cobcrun HelloWorld
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

libcob: entry point 'HelloWorld' not found
Run Code Online (Sandbox Code Playgroud)

任何人都可以向我解释 GnuCOBOL 中的入口点是什么,并可能提出一种解决问题并成功执行此 COBOL 程序的方法?

syntax cobol runtime-error gnucobol

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

使用rowindex从JTable检索行数据

如何从JTable使用rowindex的行检索行数据?

java swing jtable

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

标签 统计

c ×1

cobol ×1

gnucobol ×1

java ×1

jtable ×1

printf ×1

runtime-error ×1

sizeof ×1

swing ×1

syntax ×1