小编obv*_*aoe的帖子

printf()在错误的位置打印换行符

我有点像C的初学者,所以请原谅任何粗鲁的错误!

我试图用printf()打印一些格式化的值,但它在输出的中间开始换行,即使没有'\n'!问题出在442行的list_topic函数中.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>

typedef struct
{
    int t_id;
    char t_name[35];
    char date_creation[30];
    char last_post_date[30];
    int sub_users;
    int num_posts;
    char t_desc[500];
} topic;

typedef struct
{
    int u_type;
    int t_maxreach;
    int u_sub_topic[15];
    char u_name[16];
    char u_pass[16];
} utilizador;

void instalar();
void menu_inicial();
void menu_admin();
void menu_topic();
void menu_user();
void login();
void options();
void topic_gest();
void user_gest();
void stats();
void new_topic();
void alt_topic();
void rmv_topic();
void list_topic();
void new_user(); …
Run Code Online (Sandbox Code Playgroud)

c printf

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

const int* ptr[] 和 const int (*ptr)[] 的区别

有什么区别吗

const int* ptr[5];
Run Code Online (Sandbox Code Playgroud)

const int (*ptr)[5];
Run Code Online (Sandbox Code Playgroud)

?

我试图指向一个 const 5*5 2D int 数组,但我不确定最好的方法

c arrays pointers matrix

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

标签 统计

c ×2

arrays ×1

matrix ×1

pointers ×1

printf ×1