c++报错:invalid conversion from int to int

错误已表明位置,初学求轻喷...
做一个计步软件求每周的步数最大值最小值以及平均值,要求输入多组数据并在最开始输入数据的组数T
#include
#include

using namespace std;
class Step
{
public:
Step(int a[7]);
Step(const Step &c);
~Step(){}
int getMax();
int getMin();
float getAverage();
void showAnswer();
private:
static float Averstep;
int Maxstep,Minstep;
int step[7];
};
Step::Step(int a[7])
{
for(int i=0;i {
step[i]=a[i];
}
}
Step::Step(const Step &c)
{
for(int i=0;i {
step[i]=c.step[i];
}
}
float Step::getAverage()
{
for(int i=0;i Averstep=(Averstep+step[i])/7;
return Averstep;
}
int Step::getMax()
{
int Maxstep=step[0];
for (int i=1;i {
if (step[i]>Maxstep) {
Maxstep=step[i];
}
}
return Maxstep;
}
int Step::getMin()
{
int Minstep=step[0];
for (int i=1;i<=6;i++)
if (step[i] Minstep=step[i];
}
return Minstep;
}
void Step::showAnswer()
{
cout }
float Step::Averstep=0.0;
int main()
{
int T;
int step[7];
cin>>T;
while(cin>>step[0]>>step[1]>>step[2]>>step[3]>>step[4]>>step[5]>>step[6])
{
Step x(step[7]); *****(错误位置)*****
x.showAnswer();
}
return 0;
}


c++

1个回答

step【7】是一个int数,而你的step是0-6的,它越界了
应该传过去一个数组,所以用
Step x(step);

代码里for循环都不完整 我这也调试不了
//*************************

1.实例化的时候只调用了构造函数,没有用他的方法,也就是没有计算最大最小值(可以在计算最大最小的函数里打个断点),我在构造函数里执行了计算的函数所以输出是正常的
2.输入的数据组数没用,这个简单,自己改吧

#include "stdio.h"
#include "iostream"

using namespace std;

class Step
{
public:
    Step(int a[7]);
    Step(const Step &c);
    ~Step(){}
    int getMax();
    int getMin();
    float getAverage();
    void showAnswer();
private:
    static float Averstep;
    int Maxstep, Minstep;
    int step[7];
};
Step::Step(int a[7])
{
    for (int i = 0; i<7; i++) 
    {
        step[i] = a[i];
    }
    Maxstep = getMax();
    Minstep = getMin();
    Averstep = getAverage();
}
Step::Step(const Step &c)
{
    for (int i = 0; i<7; i++)
    {
        step[i] = c.step[i];
    }
}
float Step::getAverage()
{
    for (int i = 0; i<7; i++)
        Averstep = (Averstep + step[i]) / 7;
    return Averstep;
}
int Step::getMax()
{
    int Maxstep = step[0];
    for (int i = 0; i<7; i++)
    {
        if (step[i]>Maxstep) 
        {
            Maxstep = step[i];
        }
    }
    return Maxstep;
}
int Step::getMin()
{
    int Minstep = step[0];
    for (int i = 1; i <= 6; i++)
    {
        if (step[i] < Minstep)
            Minstep = step[i];
    }
return Minstep;
}
void Step::showAnswer()
{
    cout << "max" << Maxstep << endl;
    cout << "min" << Minstep << endl;
    cout << "ave" << Averstep << endl;
}


float Step::Averstep = 0.0;
int main()
{
    int T;
    int step[7];
    cin >> T;
    while (cin >> step[0] >> step[1] >> step[2] >> step[3] >> step[4] >> step[5] >> step[6])
    {
        Step x(step); 

        x.showAnswer();
    }
    system("pause");
    return 0;
}

图片说明

qq_31762199
豆丷 回复Josie0625: 之前不是cin了个T么,用个for循环,输入多组for(int i=0;i<T;i++) cin>>.....
12 个月之前 回复
Josie0625
Josie0625 这个需要多组输入输出的应该怎么修改啊
12 个月之前 回复
Josie0625
Josie0625 回复豆丷: Step::Step(int a[7]) { for(int i=0;i<7;i++) { step[i]=a[i]; } } Step::Step(const Step &c) { for(int i=0;i<7;i++) { step[i]=c.step[i]; } } 不好意思我写的是这样的 复制代码的时候没有粘贴好
12 个月之前 回复
qq_31762199
豆丷 回复Josie0625: Step::Step(int a[7]) { for(int i=0;i { step[i]=a[i]; } } Step::Step(const Step &c) { for(int i=0;i { step[i]=c.step[i]; } } 这里的for循环格式都不会 大括号也对不上
12 个月之前 回复
Josie0625
Josie0625 你好 step的问题我已经修改了 能不能帮助看看for循环哪里不完整 需要怎么改?非常感谢
12 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
c++报错:invalid conversion from int to int

错误已表明位置,初学求轻喷... 做一个计步软件求每周的步数最大值最小值以及平均值,要求输入多组数据并在最开始输入数据的组数T #include <iostream> #include <math.h> using namespace std; class Step { public: Step(int a[7]); Step(const Step &c); ~Step(){} int getMax(); int getMin(); float getAverage(); void showAnswer(); private: static float Averstep; int Maxstep,Minstep; int step[7]; }; Step::Step(int a[7]) { for(int i=0;i<7;i++) { step[i]=a[i]; } } Step::Step(const Step &c) { for(int i=0;i<7;i++) { step[i]=c.step[i]; } } float Step::getAverage() { for(int i=0;i<=6;i++) Averstep=(Averstep+step[i])/7; return Averstep; } int Step::getMax() { int Maxstep=step[0]; for (int i=1;i<=6;i++) { if (step[i]>Maxstep) { Maxstep=step[i]; } } return Maxstep; } int Step::getMin() { int Minstep=step[0]; for (int i=1;i<=6;i++) if (step[i]<Minstep) { Minstep=step[i]; } return Minstep; } void Step::showAnswer() { cout<<Maxstep<<endl<<Minstep<<endl<<floor(Averstep); } float Step::Averstep=0.0; int main() { int T; int step[7]; cin>>T; while(cin>>step[0]>>step[1]>>step[2]>>step[3]>>step[4]>>step[5]>>step[6]) { **_Step x(step[7]);_** *****(错误位置)***** x.showAnswer(); } return 0; } ``` ```

C语言编译时,提示invalid conversion from ‘char’ to ‘char*’ [-fpermissive]错误,请问哪里问题?

编译环境: Armbian(arm嵌入式linux)64位系统,基于Ubuntu Bionic 18.04 LTS 4.19内核 错误提示: ![图片说明](https://img-ask.csdn.net/upload/201902/21/1550707793_4777.png) tools.c:63:13: error: invalid conversion from ‘char’ to ‘char*’ [-fpermissive] *pout = '\0'; ^~~~ 部分代码内容: 这是图片: ![图片说明](https://img-ask.csdn.net/upload/201902/21/1550707811_128009.png) 以下是文字代码: int code_convert(char *from_charset, char *to_charset, char *inbuf, size_t inlen, char *outbuf, size_t outlen) { iconv_t cd; char **pin = &inbuf; char **pout = &outbuf; cd = iconv_open(to_charset, from_charset); if (cd == 0) return -1; memset(outbuf, 0, outlen); if (iconv(cd, pin, &inlen, pout, &outlen) == -1) return -1; iconv_close(cd); *pout = '\0'; return 0; }

invalid conversion from 'char**' to 'const char**

``` #include <iostream> using namespace std; int main() { char* a="AAAA"; char* b="BBBB"; char* c="CCCC"; const char*x=a; //二维 char *y[3]= {a,b,c}; const char** z=y; } ``` 最后一行 ``` const char** z=y; ``` 错误,求指教

warning C4244: 'argument' : conversion from 'double' to 'float', possible loss of data 具体问题在哪里呢?怎么改

#include<stdio.h> #include<math.h> int main(void){ float x1,y1,x2,y2,x3,y3; float p,a,b,c,S; printf("input three coordinates to calculate the area of the triangle:"); scanf("%f%f%f%f%f%f",&x1,&y1,&x2,&y2,&x3,&y3); a=sqrtf((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); b=sqrtf((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3)); c=sqrtf((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)); if(a>b) {t=a;a=b;b=t;} if(a>c) {t=a;a=c;c=t;} if(b>c) {t=b;b=c;c=t;} if(c=a+b) {printf("These three line segments can't be combined to be a triangle")} else if(c>a+b) { p=(a+b+c)/(2.0); S=sqrtf(p*(p-a)*(p-b)*(p-c)); printf("The area of the triangle is:%.2f",S); } return 0; }

go运行时无法编译

<div class="post-text" itemprop="text"> <p>I am just wondering why would go runtime fail to build. How do we pass flags (-fpermissive in this case) to the c compiler which golang compiler is using to build the runtime. I am using gcc-4.6.2 on ubuntu 12.04</p> <pre><code>../../../thirdparty/go1.4.2/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/src/runtime/cgo/gcc_linux_amd64.c: In function ‘void _cgo_sys_thread_start(ThreadStart*)’: ../../../thirdparty/go1.4.2/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/src/runtime/cgo/gcc_linux_amd64.c:45:41: error: invalid conversion from ‘void*’ to ‘__sigset_t*’ [-fpermissive] </code></pre> <p>A sample program written also fails to compile, it seems the nil defined in the go code is the problem, i wonder how others are working, when does the golang compiler compiles this runtime code ? </p> <pre><code>gcc t.c -lpthread -o t t.c: In function ‘void* hello_world(void*)’: t.c:12:41: error: invalid conversion from ‘void*’ to ‘__sigset_t*’ [-fpermissive] /usr/include/x86_64-linux-gnu/bits/sigthread.h:31:12: error: initializing argument 3 of ‘int pthread_sigmask(int, const __sigset_t*, __sigset_t*)’ [-fpermissive] rk@rk-VirtualBox:~$ gcc -fpermissive t.c -lpthread -o t t.c: In function ‘void* hello_world(void*)’: t.c:12:41: warning: invalid conversion from ‘void*’ to ‘__sigset_t*’ [-fpermissive] rk@rk-VirtualBox:~$ cat t.c #include&lt;pthread.h&gt; #include&lt;stdio.h&gt; #include&lt;signal.h&gt; #define nil ((void*)0) static void* hello_world(void *vptr) { sigset_t set; sigemptyset(&amp;set); pthread_sigmask(SIG_BLOCK, &amp;set, nil); printf("hello world"); return NULL; } int main(int ac, char **av) { pthread_t t; pthread_create(&amp;t, NULL, hello_world, NULL); pthread_join(t, NULL); return 0; } /usr/include/x86_64-linux-gnu/bits/sigthread.h:31:12: error: initializing argument 3 of ‘int pthread_sigmask(int, const __sigset_t*, __sigset_t*)’ [-fpermissive] make: *** [rulemanager] Error 2 </code></pre> </div>

关于C语言的指针类型转换问题?

#include <stdio.h> int main() { unsigned int a = 0; unsigned char *p = (char *)&a;//有错 p[0] = 123; p[1] = 111; p[2] = 168; p[3] = 192; printf("%u\n", a); return 0; } 结果报错:error: invalid conversion from 'char*' to 'unsigned char*' [-fpermissive]| 我在想这样为什么不可以转换呢,

c++ 这个报错是什么原因?如何解决?

以下代码在编译时报错: ``` #include<iostream> using namespace std; string type_get, str_empty, str_num1, str_num2; string to_do = "+-*/"; int empty, i, operator_num, num1, num2; int flag = 1;//flag=1:运行,flag=0:退出 int plus(int num1,int num2) { int result; result = num1 + num2; return result; } int minus(int num1,int num2) { int result; result = num1 - num2; return result; } int multiply(int num1,int num2) { int result; result = num1 * num2; return result; } int divide(int num1,int num2) { int result; result = num1 / num2; return result; } int main() { while(flag) { cin >> type_get; if (type_get == "exit") { flag = 0; } else { operator_num = type_get.find_first_of(to_do); char array_type_get[type_get.length()]; for (i = 0; i < type_get.length(); i++) { array_type_get[i] = type_get[i]; } for (i = 0; i < operator_num; i++) { str_num1[i] = array_type_get[i]; } for (i = operator_num + 1; i < sizeof(array_type_get); i++) { str_num2[i] = array_type_get[i]; } num1 = atoi(str_num1.c_str()); num2 = atoi(str_num2.c_str()); switch (array_type_get[operator_num]) { case "+" : plus(num1,num2); break; case "-" : minus(num1,num2); break; case "*" : multiply(num1,num2); break; case "/" : divide(num1,num2); break; default : cout << "请输入一个运算符!" << endl; break; } } } return 0; } ``` 报错信息如下: ``` calculator.cpp: In function 'int main()': calculator.cpp:73:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive] case "+" : ^~~ calculator.cpp:73:10: error: conversion from pointer type 'const char (*)[2]' to arithmetic type 'int' in a constant expression calculator.cpp:74:6: error: reference to 'plus' is ambiguous plus(num1,num2); ^~~~ In file included from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\string:48, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\locale_classes.h:40, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\ios_base.h:41, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ios:42, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ostream:38, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\iostream:39, from calculator.cpp:1: c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\stl_function.h:147:12: note: candidates are: 'template<class _Tp> struct std::plus' struct plus; ^~~~ calculator.cpp:8:5: note: 'int plus(int, int)' int plus(int num1,int num2) ^~~~ calculator.cpp:77:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive] case "-" : ^~~ calculator.cpp:77:10: error: conversion from pointer type 'const char (*)[2]' to arithmetic type 'int' in a constant expression calculator.cpp:78:6: error: reference to 'minus' is ambiguous minus(num1,num2); ^~~~~ In file included from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\string:48, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\locale_classes.h:40, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\ios_base.h:41, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ios:42, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\ostream:38, from c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\iostream:39, from calculator.cpp:1: c:\mingw\lib\gcc\mingw32\8.2.0\include\c++\bits\stl_function.h:150:12: note: candidates are: 'template<class _Tp> struct std::minus' struct minus; ^~~~~ calculator.cpp:15:5: note: 'int minus(int, int)' int minus(int num1,int num2) ^~~~~ calculator.cpp:81:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive] case "*" : ^~~ calculator.cpp:81:10: error: conversion from pointer type 'const char (*)[2]' to arithmetic type 'int' in a constant expression calculator.cpp:85:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive] case "/" : ^~~ calculator.cpp:85:10: error: conversion from pointer type 'const char (*)[2]' to arithmetic type 'int' in a constant expression ``` **_在这上面卡了好几天了,求各位大神解答!_**

linux c++ sds库 提示 undefined reference to `sdsempty()'

> 报错: > /tmp/cc3R3ayZ.o: In function 'main' > c.cpp:(.text+0x9): undefined reference to 'sdsempty()' > collect2: error: ld returned 1 exit status** ``` #include <iostream> #include <unistd.h> #include <sds.h> using namespace std; int main(){ sds s= sdsempty(); return 0; } ``` 我更新了sds文件,然后: ``` [root@localhost c4]# g++ -std=c++11 -o test -I/wgs/sds c.cpp In file included from c.cpp:3:0: /wgs/sds/sds.h: In function ‘size_t sdsavail(sds)’: /wgs/sds/sds.h:83:87: error: invalid conversion from ‘void*’ to ‘sdshdr8*’ [-fpermissive] #define SDS_HDR_VAR(T,s) struct sdshdr##T *sh = (void*)((s)-(sizeof(struct sdshdr##T))); ^ /wgs/sds/sds.h:111:13: note: in expansion of macro ‘SDS_HDR_VAR’ SDS_HDR_VAR(8,s); ^ /wgs/sds/sds.h:83:87: error: invalid conversion from ‘void*’ to ‘sdshdr16*’ [-fpermissive] #define SDS_HDR_VAR(T,s) struct sdshdr##T *sh = (void*)((s)-(sizeof(struct sdshdr##T))); ^ /wgs/sds/sds.h:115:13: note: in expansion of macro ‘SDS_HDR_VAR’ SDS_HDR_VAR(16,s); ^ /wgs/sds/sds.h:83:87: error: invalid conversion from ‘void*’ to ‘sdshdr32*’ [-fpermissive] #define SDS_HDR_VAR(T,s) struct sdshdr##T *sh = (void*)((s)-(sizeof(struct sdshdr##T))); ^ /wgs/sds/sds.h:119:13: note: in expansion of macro ‘SDS_HDR_VAR’ SDS_HDR_VAR(32,s); ^ /wgs/sds/sds.h:83:87: error: invalid conversion from ‘void*’ to ‘sdshdr64*’ [-fpermissive] #define SDS_HDR_VAR(T,s) struct sdshdr##T *sh = (void*)((s)-(sizeof(struct sdshdr##T))); ^ /wgs/sds/sds.h:123:13: note: in expansion of macro ‘SDS_HDR_VAR’ SDS_HDR_VAR(64,s); ^ ``` 这个是啥原因啊?

Go无法调用C ++函数

<div class="post-text" itemprop="text"> <p>I have been using cgo to interface between Go and C. However, when trying to do the same for Go and C++, I get a compile error every time I attempt to call a function. Using <code>go build .</code> from the code's directory, I get the following errors:</p> <pre><code>./main.go: In function 'void _cgo_3612c872201c_Cfunc_getint(void*)': ./main.go:48:53: error: invalid conversion from 'void*' to '_cgo_3612c872201c_Cfunc_getint(void*)::&lt;anonymous struct&gt;*' [-fpermissive] ./main.go:54:4: error: invalid conversion from 'void*' to '_cgo_3612c872201c_Cfunc_getint(void*)::&lt;anonymous struct&gt;*' [-fpermissive] </code></pre> <p>I've put a super simple example below which shows the problem.</p> <p>main.go:</p> <pre><code>package main /* #cgo CFLAGS: -x c++ int getint() { return 1; } */ import "C" import ( "fmt" ) func main() { fmt.Println(C.getint()) } </code></pre> <p>Does anyone know if this is a bug in cgo, or something wrong with how I wrote the code? According to the <a href="https://golang.org/cmd/cgo/" rel="nofollow noreferrer">cgo documentation</a>, C++ is supported. I'm using Go version 1.7.5 for linux/amd64.</p> <p>Thanks so much!</p> </div>

救救孩子???指针数组

#include<stdio.h> int perimeter(int x,int y); int area(int x,int y); int solution(int x,int y,int(*ptr)()); int main() { int a,b; printf(" 请输入A和B的值:"); scanf("%d%d",&a,&b); printf(" Perimeter of a rectangle:"); solution(a,b,perimeter); printf(" Area of a rectangle:"); solution(a,b,area); } int perimeter(int x,int y) { return (2*(x+y)); } int area(int x,int y) { return x*y; } int solution(int x,int y,int(*ptr)()) { int result; result=(*ptr)(x,y); printf("%d\n",result); } [Error] C:\Users\H\Documents\C-Free\Temp\未命名1.cpp:11: error: invalid conversion from `int (*)(int, int)' to `int (*)()'

初学c++ 这个求最大值的哪里错了? :)

![图片说明](https://img-ask.csdn.net/upload/201909/29/1569761105_402677.png) 这个求最大值的哪里错了? :)

opencv的 FastFeatureDetector fast(40)怎么用不了

#include <QCoreApplication> #include <opencv2/core/core.hpp> #include <opencv2/features2d/features2d.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace cv; int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); Mat image; image = imread("1.jpg"); // 存储为关键点 std::vector<KeyPoint> keyPoints; // 定义特征检测 FastFeatureDetector fast(40); // 检测的阈值为40 “cv::FastFeatureDetector”: 不能实例化抽象类 // 特征点检测 fast.detect(image,keyPoints); drawKeypoints(image, keyPoints, image, Scalar::all(255), DrawMatchesFlags::DRAW_OVER_OUTIMG); imshow("FAST feature", image); waitKey(0); return a.exec(); } error: C2259: “cv::FastFeatureDetector”: 不能实例化抽象类 error: C2664: “cv::FastFeatureDetector::FastFeatureDetector(cv::FastFeatureDetector &&)”: 无法将参数 1 从“int”转换为“const cv::FastFeatureDetector &”

函数转换时碰到问题,未破,求助各位朋友,非常感谢!!!

**编译时的错误提示:** pmd/pmdEDU.cpp: In function ‘int (* getEntryFuncByType(EDU_TYPES))(pmdEDUCB*, void*)’: pmd/pmdEDU.cpp:94:4: error: invalid conversion from ‘int (*)(pmdEDUCB, void*)’ to ‘pmdEntryPoint {aka int (*)(pmdEDUCB*, void*)}’ [-fpermissive] } ; **其中函数的声明及实现如下:** 头文件中声明: pmdEDU.hpp typedef int (*pmdEntryPoint) ( pmdEDUCB *, void * ) ; pmdEntryPoint getEntryFuncByType ( EDU_TYPES type ) ; int pmdAgentEntryPoint ( pmdEDUCB *cb, void *arg ) ; pmdEDU.cpp文件中实现代码如下: struct _eduEntryInfo { EDU_TYPES type ; int regResult ; pmdEntryPoint entryFunc ; } ; define ON_EDUTYPE_TO_ENTRY1(type,system,entry,desp) \ { type, registerEDUName(type,desp,system), entry } pmdEntryPoint getEntryFuncByType ( EDU_TYPES type ) { pmdEntryPoint rt = NULL ; static const _eduEntryInfo entry[] = { ON_EDUTYPE_TO_ENTRY1 ( EDU_TYPE_AGENT, false, pmdAgentEntryPoint, "Agent" ), ON_EDUTYPE_TO_ENTRY1 ( EDU_TYPE_TCPLISTENER, true, pmdTcpListenerEntryPoint, "TCPListener" ), ON_EDUTYPE_TO_ENTRY1 ( EDU_TYPE_MAXIMUM, false, NULL, "Unknown" ) } ; static const unsigned int number = sizeof ( entry ) / sizeof ( _eduEntryInfo ) ; unsigned int index = 0 ; for ( ; index < number; ++index ) { if ( entry[index].type == type ) { rt = entry[index].entryFunc ; goto done ; } } done : return rt ; } 编译环境:debian sid g++4.8.2 我没发现问题出现在哪儿,烦劳各位了

关于Vector<>和interator中的无效转换问题.

本人在使用GEANT4模拟,以下为部分相关程序.目的是获得次级粒子的能量等信息,当gamma被kill或stop后,开始追踪次级粒子,并加以筛选获得输出文件.然而在编译的时候出现了以下报错:**error: invalid conversion from ‘const G4TrackVector* {aka const std::vector<G4Track*>*}’ to ‘G4TrackVector* {aka std::vector<G4Track*>*}’ [-fpermissive] G4TrackVector* fpTrackVector = fStep->GetSecondary(); ** ^ 求各位帮我看看,感激不尽呀,由于金币不足,待日后补齐各位热心人.**** //do the calculation of energy deposition G4TrackVector* fpTrackVector = fStep->GetSecondary(); G4TrackStatus TrackStatus = fTrack->GetTrackStatus(); if ( particle == "neutron" && TrackStatus == fStopAndKill ){ G4int i; vector <G4Track*>::const_iterator itr; G4int tv_size = fpTrackVector->size (); itr = fpTrackVector->begin (); if( tv_size ) { for ( i=0;i<tv_size;i++){ //why not "<="? G4Track* secondaryTrack = *(itr+i); G4double sec_x = secondaryTrack->GetPosition().x()/mm; G4double sec_y = secondaryTrack->GetPosition().y()/mm; G4double sec_z = secondaryTrack->GetPosition().z()/mm; G4String sec_name = secondaryTrack->GetDefinition()->GetParticleName(); G4String sec_volume = secondaryTrack->GetVolume()->GetName(); G4double sec_kineticEnergy = secondaryTrack->GetKineticEnergy()/MeV; G4double sec_totalEnergy = secondaryTrack->GetTotalEnergy()/MeV; G4String sec_process = secondaryTrack->GetProcessName(); if( sec_volume == "Scatter" && sec_name == "alpha" ){ G4int SL = sec_name.size( ); //fUserDataFile->func(); fUserDataFile->AddElectronInitial ( eventNum, SL, sec_name, sec_x, sec_y, sec_z, sec_kineticEnergy ); //fUserDataFile->func(); //G4cout << "step!" << G4endl; */ } } } }

如何在arduino IDE中解析json数组

<div class="post-text" itemprop="text"> <p>I am trying to parse a JSON array on a Pi server via wifi. I want to parse the following:</p> <blockquote> <p>[{"Device":"Curtain","Value":"1"},{"Device":"Fan","Value":"1"},{"Device":"Blinds","Value":"0"},{"Device":"Relay","Value":"0"}]</p> </blockquote> <p>Those are copied from the webpage:<a href="http://pi.access.com/states.php" rel="nofollow">http://pi.access.com/states.php</a></p> <p>the following are my Arduino code.</p> <pre><code>#include &lt;ArduinoJson.h&gt; void setup() { Serial.begin(9600); while (!Serial) { // wait serial port initialization } StaticJsonBuffer&lt;200&gt; jsonBuffer; char json[] = "[{\"Device\":\"Curtain\",\"Value\":\"1\"},{\"Device\":\"Fan\",\"Value\":\"1\"}]"; JsonArray&amp; root = jsonBuffer.parseArray(json); // Test if parsing succeeds. if (!root.success()) { Serial.println("parseObject() failed"); return; } // Fetch values. const char* device[] = root["Device"]; int value[] = root["Value"]; // Print values. Serial.println(device); Serial.println(value); } </code></pre> <p>Then I got a bunch of errors...</p> <pre><code>JsonParseExample.ino: In function 'void setup()': JsonParseExample:54: error: invalid conversion from 'const char*' to 'size_t {aka unsigned int}' [-fpermissive] In file included from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/JsonArray.hpp:181:0, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson.h:9, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:14, from JsonParseExample.ino:8: /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/JsonArray.ipp:16:27: error: initializing argument 1 of 'ArduinoJson::JsonArraySubscript ArduinoJson::JsonArray::operator[](size_t)' [-fpermissive] inline JsonArraySubscript JsonArray::operator[](size_t index) { ^ JsonParseExample:54: error: initializer fails to determine size of 'device' JsonParseExample:54: error: array must be initialized with a brace-enclosed initializer JsonParseExample:58: error: call of overloaded 'println(const char* [1])' is ambiguous JsonParseExample.ino:58:24: note: candidates are: In file included from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/Internals/../Internals/../Arduino/Print.hpp:87:0, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/Internals/../Internals/DummyPrint.hpp:10, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/Internals/../Internals/JsonPrintable.hpp:11, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/Internals/../JsonVariant.hpp:13, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/Internals/../JsonBuffer.hpp:15, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/Internals/BlockJsonBuffer.hpp:10, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson/DynamicJsonBuffer.hpp:10, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/../include/ArduinoJson.h:8, from /Users/Wei0928/Documents/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:14, from JsonParseExample.ino:8: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:73:12: note: size_t Print::println(char) &lt;near match&gt; size_t println(char); ^ /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:73:12: note: no known conversion for argument 1 from 'const char* [1]' to 'char' /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:74:12: note: size_t Print::println(unsigned char, int) &lt;near match&gt; size_t println(unsigned char, int = DEC); ^ /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:74:12: note: no known conversion for argument 1 from 'const char* [1]' to 'unsigned char' /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:75:12: note: size_t Print::println(int, int) &lt;near match&gt; size_t println(int, int = DEC); ^ /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:75:12: note: no known conversion for argument 1 from 'const char* [1]' to 'int' /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:76:12: note: size_t Print::println(unsigned int, int) &lt;near match&gt; size_t println(unsigned int, int = DEC); ^ /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:76:12: note: no known conversion for argument 1 from 'const char* [1]' to 'unsigned int' /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:77:12: note: size_t Print::println(long int, int) &lt;near match&gt; size_t println(long, int = DEC); ^ /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:77:12: note: no known conversion for argument 1 from 'const char* [1]' to 'long int' /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:78:12: note: size_t Print::println(long unsigned int, int) &lt;near match&gt; size_t println(unsigned long, int = DEC); ^ /Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Print.h:78:12: note: no known conversion for argument 1 from 'const char* [1]' to 'long unsigned int' JsonParseExample:59: error: 'value' was not declared in this scope invalid conversion from 'const char*' to 'size_t {aka unsigned int}' [-fpermissive] </code></pre> <p>Top of that I still haven't figured out how to read the array individually. Any advice is appreciated.</p> </div>

Windows 系统编程:cannot convert from 'LPTSTR []' to 'LPCTSTR *'

小弟在学习系统编程(所用书籍Windows系统编程,第四版,WIN7,VS2010),在运行书上给的样板程序时出现了这个问题。 int _tmain (int argc, LPTSTR argv[]){ ... iFirstFile = Options (argc, argv, _T("s"), &dashS, NULL); ... } 其中: DWORD Options(int,LPCTSTR *,...) 请问各位大虾这种问题应该怎么解决?

Linux下编程遇到的转换错误,要如何修改?

main.cc:118:43: error: invalid conversion from ‘void*’ to ‘_u32* {aka unsigned int*}’ [-fpermissive] cache->addr_list = realloc(cache->addr_list, cache->addr_list_size * sizeof(_u32)); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cc: In function ‘void reset_cache_sim(cache_sim*, int, int)’: main.cc:179:42: error: invalid conversion from ‘void*’ to ‘_u8* {aka unsigned char*}’ [-fpermissive] cache->cache_buf = malloc(cache->cache_size); ~~~~~~^~~~~~~~~~~~~~~~~~~ main.cc:189:31: error: invalid conversion from ‘void*’ to ‘cache_item*’ [-fpermissive] cache->caches = malloc(sizeof(struct cache_item) * cache->cache_item_num); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.cc: In function ‘void load_trace(cache_sim*, char*)’: main.cc:361:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] do_cache_op(cache, (void*)addr, 1); ^~~~ main.cc:364:51: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] do_cache_op(cache, (void*)addr, 0); ^~~~ main.cc: At global scope: main.cc:411:55: error: ISO C++ forbids declaration of ‘do_test’ with no type [-fpermissive] static do_test(struct cache_sim* cache, char* filename) ^ main.cc: In function ‘int main(int, char**)’: main.cc:429:94: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] st_cases[] = {"gcc.trace","gzip.trace","mcf.trace","swim.trace","twolf.trace"}; ^ main.cc:429:94: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] main.cc:429:94: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] main.cc:429:94: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] main.cc:429:94: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 错误描述是这样的,求大神解答

如何在 Python 中将字符串解析为 float 或 int?

<div class="post-text" itemprop="text"> <p>In Python, how can I parse a numeric string like <code>"545.2222"</code> to its corresponding float value, <code>542.2222</code>? Or parse the string <code>"31"</code> to an integer, <code>31</code>?</p> <p>I just want to know how to parse a <em>float</em> <code>string</code> to a <code>float</code>, and (separately) an <em>int</em> <code>string</code> to an <code>int</code>.</p> </div> <p>转载于:https://stackoverflow.com/questions/379906/how-do-i-parse-a-string-to-a-float-or-int-in-python</p>

向函数模板中传入字符串,typeid()和if的搭配会失效,编译不通过,怎么办?

我写了个函数模板里用到了typeid,判断传入变量的类型。传入整型和浮点型都没问题,传入字符串直接编译不通过。 ```C #include <iostream> #include <typeinfo> #include <string> using namespace std; struct Item { int intvalue=0; double doublevalue=0.0; string stringvalue=""; }; template <typename T> void TypeDetect(Item *p, T elem) { if (*typeid(elem).name() == 'i') p->intvalue = elem; else if (*typeid(elem).name() == 'd') p->doublevalue = elem; else if (*typeid(elem).name() == 'P') p->stringvalue = elem; } int main() { Item *p1 = new Item, *p2 = new Item, *p3 = new Item; TypeDetect(p1, 1); TypeDetect(p2, 1.1); TypeDetect(p3, "abc"); cout << p1->intvalue << endl; cout << p2->doublevalue << endl; cout << p3->stringvalue << endl; return 0; } ``` 直接编译上述代码会报错: invalid conversion from 'const char*' to 'int' [-fpermissive] [15, 21] cannot convert 'const char*' to 'double' in assignment [17, 24] 但注释掉 ```C TypeDetect(p3, "abc"); ``` 就可以编译运行了。这是为什么?传入字符串后typeid应该会判断它是一个指针,然后通过if语句判断,但似乎编译器就不认我写的三个if语句。

我可以在cgo中使用c ++吗?

<div class="post-text" itemprop="text"> <p>Is it possible to mix in some C++ code in cgo?</p> <p>I tried this:</p> <pre><code>package main /* #include &lt;iostream&gt; extern "C" void test(const char* str) { std::cout &lt;&lt; str; } */ // #cgo CFLAGS: -x c++ // #cgo LDFLAGS: -lstdc++ import "C" func main() { C.test(C.CString("Testing!!!")) } </code></pre> <p>But I get these errors:</p> <pre><code>error: 'char* CString(_GoString_)' cannot appear in a constant-exp error: 'void test(const char*)' cannot appear in a constant-expres error: invalid conversion from 'char* (*)(_GoString_)' to 'long long int' [-fpermissive] error: invalid conversion from 'void (*)(const char*)' to 'long long int' [-fpermissive] </code></pre> <p>I'm using go1.0.2 and MinGW-w64 4.7.1 </p> </div>

C/C++学习指南全套教程

C/C++学习的全套教程,从基本语法,基本原理,到界面开发、网络开发、Linux开发、安全算法,应用尽用。由毕业于清华大学的业内人士执课,为C/C++编程爱好者的教程。

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

YOLOv3目标检测实战:训练自己的数据集

YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

浪潮集团 往年的软件类 笔试题 比较详细的哦

浪潮集团 往年的软件类 笔试题 比较详细的哦

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

I2c串口通信实现加速度传感器和FPGA的交流

此代码能实现加速度传感器与FPGA之间的交流,从而测出运动物体的加速度。

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

微信公众平台开发入门

本套课程的设计完全是为初学者量身打造,课程内容由浅入深,课程讲解通俗易懂,代码实现简洁清晰。通过本课程的学习,学员能够入门微信公众平台开发,能够胜任企业级的订阅号、服务号、企业号的应用开发工作。 通过本课程的学习,学员能够对微信公众平台有一个清晰的、系统性的认识。例如,公众号是什么,它有什么特点,它能做什么,怎么开发公众号。 其次,通过本课程的学习,学员能够掌握微信公众平台开发的方法、技术和应用实现。例如,开发者文档怎么看,开发环境怎么搭建,基本的消息交互如何实现,常用的方法技巧有哪些,真实应用怎么开发。

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

eclipseme 1.7.9

eclipse 出了新的eclipseme插件,官方有下载,但特慢,我都下了大半天(可能自己网速差)。有急需要的朋友可以下哦。。。

Spring Boot -01- 快速入门篇(图文教程)

Spring Boot -01- 快速入门篇 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到【慕课网】手机 app,去找【Spring Boot 2.0 深度实践】的课程,令人开心的是,课程完全免费! 什么是 Spring Boot? Spring Boot 是由 Pivotal 团队提供的全新框架。Spring Boot...

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

最简单的倍频verilog程序(Quartus II)

一个工程文件 几段简单的代码 一个输入一个输出(50Mhz倍频到100Mhz)

计算机组成原理实验教程

西北工业大学计算机组成原理实验课唐都仪器实验帮助,同实验指导书。分为运算器,存储器,控制器,模型计算机,输入输出系统5个章节

4小时玩转微信小程序——基础入门与微信支付实战

这是一个门针对零基础学员学习微信小程序开发的视频教学课程。课程采用腾讯官方文档作为教程的唯一技术资料来源。杜绝网络上质量良莠不齐的资料给学员学习带来的障碍。 视频课程按照开发工具的下载、安装、使用、程序结构、视图层、逻辑层、微信小程序等几个部分组织课程,详细讲解整个小程序的开发过程

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

基于RSA通信密钥分发的加密通信

基于RSA通信密钥分发的加密通信,采用pycrypto中的RSA、AES模块实现

不同变质程度煤尘爆炸残留气体特征研究

为分析不同变质程度煤尘爆炸残留气体成分的特征规律,利用水平管道煤尘爆炸实验装置进行了贫瘦煤、肥煤、气煤、长焰煤4种不同变质程度的煤尘爆炸实验,研究了不同变质程度煤尘爆炸后气体残留物含量的差异,并对气体

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

软件测试2小时入门

本课程内容系统、全面、简洁、通俗易懂,通过2个多小时的介绍,让大家对软件测试有个系统的理解和认识,具备基本的软件测试理论基础。 主要内容分为5个部分: 1 软件测试概述,了解测试是什么、测试的对象、原则、流程、方法、模型;&nbsp; 2.常用的黑盒测试用例设计方法及示例演示;&nbsp; 3 常用白盒测试用例设计方法及示例演示;&nbsp; 4.自动化测试优缺点、使用范围及示例‘;&nbsp; 5.测试经验谈。

几率大的Redis面试题(含答案)

本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...

手把手实现Java图书管理系统(附源码)

【超实用课程内容】 本课程演示的是一套基于Java的SSM框架实现的图书管理系统,主要针对计算机相关专业的正在做毕设的学生与需要项目实战练习的java人群。详细介绍了图书管理系统的实现,包括:环境搭建、系统业务、技术实现、项目运行、功能演示、系统扩展等,以通俗易懂的方式,手把手的带你从零开始运行本套图书管理系统,该项目附带全部源码可作为毕设使用。 【课程如何观看?】 PC端:https://edu.csdn.net/course/detail/27513 移动端:CSDN 学院APP(注意不是CSDN APP哦) 本课程为录播课,课程2年有效观看时长,大家可以抓紧时间学习后一起讨论哦~ 【学员专享增值服务】 源码开放 课件、课程案例代码完全开放给你,你可以根据所学知识,自行修改、优化

jsp+servlet入门项目实例

jsp+servlet实现班级信息管理项目

winfrom中嵌套html,跟html的交互

winfrom中嵌套html,跟html的交互,源码就在里面一看就懂,很简单

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

python实现数字水印添加与提取及鲁棒性测试(GUI,基于DCT,含测试图片)

由python写的GUI,可以实现数字水印的添加与提取,提取是根据添加系数的相关性,实现了盲提取。含有两种攻击测试方法(高斯低通滤波、高斯白噪声)。基于python2.7,watermark.py为主

Xshell6完美破解版,亲测可用

Xshell6破解版,亲测可用,分享给大家。直接解压即可使用

你连存活到JDK8中著名的Bug都不知道,我怎么敢给你加薪

CopyOnWriteArrayList.java和ArrayList.java,这2个类的构造函数,注释中有一句话 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public ArrayList(Collection&lt;? ...

相关热词 c# 不能序列化继承类 c# char* 调用 c# 开发dll模板 c#添加控件到工具箱 c#控制台组合数 编程计算猴子吃桃问题c# c# wpf 背景透明 随机抽取号码软件c# c# 开发环境 c# 属性和字段
立即提问