相关疑难解决方法(0)

"错误:流浪'\ 342'","迷失'\'200'","迷失'\'213'"在C编译中

这是我的代码

int main()?
{
    float avg, age[] = { 23.4, 55, 22.6, 3, 40.5, 18 };
    avg = average(age); /* Only name of array is passed as argument. */
    printf("Average age=%.2f", avg);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

编译错误int main():

error: stray '\342' in program
error: stray '\200' in program
error: stray '\213' in program
Run Code Online (Sandbox Code Playgroud)

c

-1
推荐指数
1
解决办法
2126
查看次数

在C/C++中以指数形式将浮点数声明为宏的正确方法是什么?

我试图创建一个非常简单的程序来计算C++中两个对象之间的引力,所以我想为G声明一个宏,其值等于6.754*10 ^ -11,我用它 -

#define G 6.754e-11.0;
Run Code Online (Sandbox Code Playgroud)

但是它产生了很多杂散错误,如下所示 -

aalpanigrahi@aalpanigrahi:~/Desktop/CS/C++/Other PSETS$ g++ gravity.cpp -o gravity
gravity.cpp:5:28: error: stray ‘\342’ in program
 #define G (6.754)*pow(10.0,??11.0);
                            ^
gravity.cpp:10:52: note: in expansion of macro ‘G’
     float gforce(float m1,float m2,float r){return G*m1*m2/(r*r);}
                                                    ^
gravity.cpp:5:29: error: stray ‘\210’ in program
 #define G (6.754)*pow(10.0,??11.0);
                             ^
gravity.cpp:10:52: note: in expansion of macro ‘G’
     float gforce(float m1,float m2,float r){return G*m1*m2/(r*r);}
                                                    ^
gravity.cpp:5:30: error: stray ‘\222’ in program
 #define G (6.754)*pow(10.0,?11.0);
                              ^
gravity.cpp:10:52: note: in expansion of macro ‘G’ …
Run Code Online (Sandbox Code Playgroud)

c++ macros

-1
推荐指数
1
解决办法
62
查看次数

"Stray'\ 226'在程序中"编译器错误

我写了以下代码.它是实现双链表.但错误突然出现.

while(x==1); // This line showed errors
return 1;     
Run Code Online (Sandbox Code Playgroud)

错误:

DoublyLinkedList.c: In function `main':
DoublyLinkedList.c:194: error: stray '\226' in program
DoublyLinkedList.c:194: error: stray '\128' in program
DoublyLinkedList.c:194: error: stray '\156' in program
DoublyLinkedList.c:194: error: `The' undeclared (first use in this function)
DoublyLinkedList.c:194: error: (Each undeclared identifier is reported only once
DoublyLinkedList.c:194: error: for each function it appears in.)
DoublyLinkedList.c:194: error: parse error before "list"
DoublyLinkedList.c:194: error: stray '\226' in program
DoublyLinkedList.c:194: error: stray '\128' in program
DoublyLinkedList.c:194: error: stray '\157' …
Run Code Online (Sandbox Code Playgroud)

c

-2
推荐指数
1
解决办法
2万
查看次数

在与负数进行比较时,在程序中迷路'\ 342'

每当我与负数GCC进行比较时,我都会看到:

error: stray '\342' in program
   if ( -4 < ÔÇô3 ) return 1;
   ^
compilation terminated due to -Wfatal-errors.
Run Code Online (Sandbox Code Playgroud)

码:

int main() {
  if ( -4 < –3 ) return 1;
  return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ gcc compiler-errors

-2
推荐指数
1
解决办法
179
查看次数

标签 统计

c ×2

c++ ×2

compiler-errors ×1

gcc ×1

macros ×1