新字符错误C(新的未声明) [英] new char error C (new undeclared)

查看:76
本文介绍了新字符错误C(新的未声明)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道为什么新版本给我一个错误。这是代码。谢谢您的帮助。

I do not know why the new is giving me an error. This is the code. Thank you for the help.

#include <stdio.h>

float promedio(int x[], int nValores);

int main(){

   FILE *bin, *archivoSalida;

   char *entrada, *salida;
   int num;
   int contador = 0;
   int nValores=10000;



   entrada = new char[50];
   salida = new char[50];


推荐答案

没有 new in C。

尝试: char entrada [50],salida [50];

为了获得更好的可读性,请尝试:

For better readability try:

char entrada[50] = { 0 };
char salida[50]  = { 0 };

这篇关于新字符错误C(新的未声明)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆