为啥说找不到标识符!???

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了为啥说找不到标识符!???相关的知识,希望对你有一定的参考价值。

本人刚学数据结构不久。。。哎……蛋疼啊!能否帮我改改!
#include"stdio.h"
#include"conio.h"
#define ListSize 100 //表空间大小可根据实际需要而定,这里假设为100
typedef int DataType;
typedef struct //顺序表的定义

DataType data[ListSize]; //数组data用于存放表结点
int length; //当前的表长度
SeqList;
void main()

SeqList L;
L.length=0; //顺序表初始长度为0
int i;
void CreateList(SeqList *L); //建立顺序表L
CreateList(&L);
void PrintList(SeqList L); //打印顺序表L
PrintList(L);
printf("最大元素:%d\n",Max(L));//链表中最大元素
printf("最小元素:%d\n",Min(L));//链表中最小元素
getch();

void CreateList(SeqList *L) //顺序表的建立,先确定输入数据元素个数,再依次输入数据元素

int i,n;
printf("请输入链表表长:");
scanf("%d",&n);
printf("请依次输入链表:");
for (i=1; i<=n; i++)
scanf("%d",&L->data[i]);
L->length=n;

void PrintList(SeqList L) //顺序表的打印,依次输出

int i;
printf(" ");
for (i=1; i<=L.length; i++)
printf("%d ",L.data[i] );
printf("\n");

int Max(SeqList L)

int i=1,p=0;
for(;i<L.length;i++)

if(L.data[p]>L.data[i])
p=i;

return L.data[p];

int Min(SeqList L)

int i=1,p=0;
for(;i<L.length;i++)

if(L.data[p]<L.data[i])
p=i;

return L.data[p];

提示说:
1>f:\编程\projects\数据结构\数据结构\结构.cpp(19): error C3861: “Max”: 找不到标识符
1>f:\编程\projects\数据结构\数据结构\结构.cpp(20): error C3861: “Min”: 找不到标识符

为什么呢??帮改一下!

你虽然定义了min和max,但是他们的位置比较靠后,在定义他们之前你就已经使用了,所以程序找不到min和max

你可以在使用min和max之前就声明或者定义他们,就是说把这两个函数放在main之前
如果不想这样的话,可以在main之前声明一下min和max,
这样程序会自动在后面寻找到他们的
一般来说main函数最好放在最后
参考技术A 如果是在VS2008及以上运行的程序,将函数 max 改为 MAX 即可实现。

npm install 说找不到文件

【中文标题】npm install 说找不到文件【英文标题】:npm install says cannot find file 【发布时间】:2019-05-05 21:20:33 【问题描述】:

我正在克隆一个 repo,运行 npm install 时出现以下错误

ENOENT:没有这样的文件或目录,重命名 '/Users/waston/Desktop/hm/STEMuli_MaterialUI/node_modules/.staging/client-6b05b6f7/node_modules/@babel/helper-module-imports' -> '/Users/ waston/Desktop/hm/STEMuli_MaterialUI/node_modules/.staging/@babel/helper-module-imports-b86e8d76'

我想如果我这样做 npm install --save-dev @babel/helper-module-imports 可能会解决它,但即使这样做也会给我同样的错误。

package.json(服务器)

    "dependencies": 
        "azure-storage": "^2.10.2",
        "bcryptjs": "^2.4.3",
        "body-parser": "^1.18.2",
        "cd": "^0.3.3",
        "client": "file:client",
        "concurrently": "^3.5.1",
        "express": "^4.16.3",
        "gravatar": "^1.6.0",
        "install": "^0.12.2",
        "into-stream": "^4.0.0",
        "jsonwebtoken": "^8.2.0",
        "mongoose": "^5.0.12",
        "multer": "^1.4.1",
        "multer-azure-storage": "^0.2.0",
        "node-sass": "^4.10.0",
        "npm": "^6.4.1",
        "passport": "^0.4.0",
        "passport-jwt": "^4.0.0",
        "validator": "^9.4.1"
      ,
 "scripts": 
    "client-install": "npm install --prefix client",
    "start": "node server.js",
    "server": "nodemon server.js",
    "client": "npm start --prefix client",
    "dev": "concurrently \"npm run server\" \"npm run client\"",
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
  

客户端包.json "

dependencies": 
    "@babel/runtime": "7.0.0-beta.55",
    "@material-ui/core": "1.5.0",
    "@material-ui/icons": "2.0.2",
    "@types/googlemaps": "3.30.11",
    "@types/markerclustererplus": "2.1.33",
    "ajv": "6.5.2",
    "axios": "^0.18.0",
    "blueimp-file-upload": "^9.22.0",
    "chartist": "0.10.1",
    "cloudinary-jquery-file-upload": "^2.5.0",
    "cloudinary-react": "^1.0.6",
    "fullcalendar": "^3.0.0",
    "fullcalendar-reactwrapper": "^1.0.7",
    "fullcalendar-reactwrapper-scheduler": "^1.0.7",
    "history": "4.7.2",
    "install": "^0.12.2",
    "jquery": "^3.3.1",
    "jwt-decode": "^2.2.0",
    "material-design-icons": "^3.0.1",
    "moment": "^2.22.2",
    "moment-timezone": "^0.5.21",
    "node-sass-chokidar": "1.3.3",
    "npm": "^6.4.1",
    "npm-run-all": "4.1.3",
    "perfect-scrollbar": "1.4.0",
    "prop-types": "15.6.2",
    "react": "^16.3.1",
    "react-big-calendar": "^0.19.2",
    "react-bootstrap": "^0.32.1",
    "react-bootstrap-sweetalert": "4.4.1",
    "react-chartist": "0.13.1",
    "react-chat-widget": "^2.1.4-1",
    "react-datetime": "2.15.0",
    "react-dnd": "^5.0.0",
    "react-dnd-html5-backend": "^5.0.1",
    "react-dom": "^16.3.1",
    "react-file-viewer": "^0.5.0",
    "react-google-maps": "9.4.5",
    "react-icons": "^3.0.5",
    "react-jvectormap": "0.0.3",
    "react-material-icons": "^1.0.3",
    "react-moment": "^0.7.0",
    "react-nouislider": "2.0.1",
    "react-parallax": "^2.0.0",
    "react-phone-number-input": "^2.2.14",
    "react-player": "^1.6.6",
    "react-redux": "^5.0.7",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.1.4",
    "react-select": "^2.1.1",
    "react-slick": "0.23.1",
    "react-stepzilla": "^4.8.0",
    "react-svg-icons": "^0.3.0",
    "react-swipeable-views": "0.12.16",
    "react-table": "6.8.6",
    "react-tagsinput": "3.19.0",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "socket.io-client": "^2.1.1",
    "video-react": "^0.13.0"
  ,
  "devDependencies": 
    "babel-cli": "^6.26.0",
    "babel-plugin-module-resolver": "^3.1.1",
    "babel-plugin-import-rename": "^1.0.1",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-plugin-transform-react-jsx": "^6.24.1",
    "babel-preset-es2015": "^6.24.1"
  ,
  "optionalDependencies": 
    "babel-eslint": "^7.2.3",
    "eslint": "^4.19.1",
    "eslint-config-prettier": "^2.9.0",
    "eslint-plugin-prettier": "^2.6.2",
    "eslint-plugin-react": "^7.10.0",
    "prettier": "^1.13.7"
  ,
  "scripts": 
    "build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/",
    "watch-css": "npm run build-css && node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o src/ --watch --recursive",
    "start-js": "react-scripts start",
    "start": "npm-run-all -p watch-css start-js",
    "build": "npm run build-css && react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject",
    "lint:check": "eslint . --ext=js,jsx;  exit 0",
    "lint:fix": "eslint . --ext=js,jsx --fix;  exit 0",
    "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
    "build-package-css": "node-sass-chokidar src/materialComponents/assets/scss/material-kit-react.scss dist/material-kit-react.css",
    "build-package": "npm run build-package-css && babel src --out-dir dist",
    "deploy": "npm run build"
  ,

【问题讨论】:

你能再试试 rm -rf node_modules && npm install 吗? @HarshShah,刚刚试了一下,结果是一样的。 你可以尝试更改 babel/runtime 版本吗? 你的意思是npm install --save @babel/runtime?如果是这样,我只是尝试过同样的事情。 你也可以做一件事删除 package-lock.json 然后删除 npm_modules 并运行命令 npm cache clean 然后运行 ​​$ npm install 【参考方案1】:

删除你的 package-lock.json 和 node_modules 文件夹,然后运行npm install

【讨论】:

我没有忽略答案,我回家后将不得不尝试这个。谢谢! 删除 package-logk.json 帮助了我,而只是删除 node_modules 没有。

以上是关于为啥说找不到标识符!???的主要内容,如果未能解决你的问题,请参考以下文章

为啥在c++编程中,用close()关闭socket 的端口号时,提示close找不到标识符,我

Javatest报错为啥说找不到测试类?

为啥查询里嵌套查询总是说找不到指定的列啊(JSP)

C语言问题:标识符为啥不能使用关键字?

为啥我的电脑上的串口不能用,,用串口调试助手的时候说找不到?

python语言怎么安装xlwt,我安装好多次了已经显示成功了,为啥一运行还说找不到xlwt模块