我正在尝试为我的模拟项目编译代码,并尝试初始化并表示我的rho数组,但遇到了初始化错误:
无法在赋值中将“大括号封闭的初始化列表”转换为“浮动”。
我需要分配rho[0]给数组的第一个成员等等。
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float lambda; // ratio of customers and time
float N; // mean number of customers in the system
float Q; // mean number of customers in queue
float res_time; // response time
float mu; // service rate , assuming mu = 10 customers/s for this assignment
int i;
float rho[10]; // array for rho values
rho[10] = { 0.1, 0.4, 0.5, 0.6, …Run Code Online (Sandbox Code Playgroud)