小编Gil*_*sen的帖子

底部的 JavaFX 阴影

我有一个问题,是否可以仅在按钮底部创建阴影?我现在正在使用这段代码,但这是在两侧。

-fx-effect: dropshadow(three-pass-box, #993300, 3, 10, 2, 3);
Run Code Online (Sandbox Code Playgroud)

已经非常感谢了。

css java javafx shadow dropshadow

5
推荐指数
0
解决办法
2169
查看次数

Sscanf没有给我一个价值

我有这段代码:

if(string_starts_with(line, "name: ") == 0){
    //6th is the first char of the name
    char name[30];
    int count = 6;
    while(line[count] != '\0'){
        name[count-6] = line[count];
        ++count;
    }
    printf("custom string name: %s", name);
    strncpy(p.name, name, 30);
}
else if(string_starts_with(line, "age: ") == 0){
    //6th is the first char of the name
    printf("age line: %s", line);
    short age = 0;
    sscanf(line, "%d", age);
    printf("custom age: %d\n", age);
}
Run Code Online (Sandbox Code Playgroud)

if作品,但else if不起作用.示例输出是:

person:
name: great
custom string name: great …
Run Code Online (Sandbox Code Playgroud)

c arrays string scanf

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

如何使用文件结构?

我有一个小问题,我有当前的文件结构: 在此输入图像描述

这是我的代码:

#include <stdio.h>
#include <stdlib.h>

const char FILE_NAME[] = "inputfile.txt";

int main()
{
    FILE *in_file;    /* input file */

    in_file = fopen(FILE_NAME, "r");
    if (in_file == NULL) {
        printf("Cannot open %s\n", FILE_NAME);
        exit(8);
    }else{
        printf("File opened %s\n", FILE_NAME);
    } 
    fclose(in_file);
    return (0);
}
Run Code Online (Sandbox Code Playgroud)

我收到这个错误:

无法打开inputfile.txt

但文件就在那里.有人能帮我吗?

(如果我将"r"更改为"w",我可以写入文件,但我在SSD上找不到该文件)

c file-io file input

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

标签 统计

c ×2

arrays ×1

css ×1

dropshadow ×1

file ×1

file-io ×1

input ×1

java ×1

javafx ×1

scanf ×1

shadow ×1

string ×1