小编rip*_*ppy的帖子

有没有办法在c中创建一个可变长度的数组?

是否有任何方法(除了malloc)用于创建具有用户输入大小的数组?

c arrays function

7
推荐指数
2
解决办法
165
查看次数

我无法在c中打开文件

我在d:drive中创建了一个名为abc的文本文件.我无法打开它.请告诉我怎么做.

#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
    FILE *fp;
    clrscr();
    fp = fopen("D:/abc.txt","r");
    if(fp == NULL)
    {
        printf("\nCannot open");
        getch();
        exit(1);
    }
    fclose(fp);
    getch();
}
Run Code Online (Sandbox Code Playgroud)

c fopen file

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

pl/sql中的数字的阶乘

以下pl/sql程序在行上执行生成错误sum:= temp*sum; 遇到符号; 期待时(.请解释我的错误.

declare
  n number;
  temp number;
  sum number := 1;
begin
  n := &n;
  temp := n;
  while temp>0 loop
    sum := temp*sum;
    temp := temp-1;
  end loop;
  dbms_output.put_line('Factorial of '||n||' is '||sum);
end;
/
Run Code Online (Sandbox Code Playgroud)

oracle plsql syntax-error

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

带有浮点的模数c

我在编译以下程序时非法使用浮点错误.请让我知道我犯了什么错误.

#include<stdio.h>
#include<conio.h>

void main()
{
    float a;
    clrscr();
    printf("\n Enter the num : ");
    scanf("%f", &a);

    if ( a >= 0 )
    {
        if ( (a % 2) == 0 ) //ERROR HERE
        {
            printf("\n You entered a positive even num");
        }
        else
        {
            printf("\n You entered a positive odd num");
        }
    }
    else
    {
        if ( (a % 2) == 0 ) //ERROR HERE
        {
            printf("\n You entered a negative even num");
        }
        else
        {
            printf("\n You entered …
Run Code Online (Sandbox Code Playgroud)

c floating-point integer floating-point-conversion

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