How do you use Xcode to edit a .cpp file? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Difference between exit and kill in C++How do you set, clear, and toggle a single bit?Git ignore file for Xcode projectsHow do I iterate over the words of a string?Why can templates only be implemented in the header file?How to “add existing frameworks” in Xcode 4?How can I disable ARC for a single file in a project?Version vs build in XcodeHow to download Xcode DMG or XIP file?Xcode process launch failed: SecurityXcode error “Could not find Developer Disk Image”
Should a wizard buy fine inks every time he want to copy spells into his spellbook?
A letter with no particular backstory
preposition before coffee
Is there hard evidence that the grant peer review system performs significantly better than random?
Why can't I install Tomboy in Ubuntu Mate 19.04?
How do living politicians protect their readily obtainable signatures from misuse?
How does the math work when buying airline miles?
Is CEO the "profession" with the most psychopaths?
What is the meaning of 'breadth' in breadth first search?
What is the home of the drow in Flanaess?
Sum letters are not two different
Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?
Why is it faster to reheat something than it is to cook it?
How to pronounce 伝統色
Dyck paths with extra diagonals from valleys (Laser construction)
Significance of Cersei's obsession with elephants?
What is Adi Shankara referring to when he says "He has Vajra marks on his feet"?
Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode
Movie where a circus ringmaster turns people into animals
How to align multiple equations
How many morphisms from 1 to 1+1 can there be?
Do I really need to have a message in a novel to appeal to readers?
How were pictures turned from film to a big picture in a picture frame before digital scanning?
What does this say in Elvish?
How do you use Xcode to edit a .cpp file?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!Difference between exit and kill in C++How do you set, clear, and toggle a single bit?Git ignore file for Xcode projectsHow do I iterate over the words of a string?Why can templates only be implemented in the header file?How to “add existing frameworks” in Xcode 4?How can I disable ARC for a single file in a project?Version vs build in XcodeHow to download Xcode DMG or XIP file?Xcode process launch failed: SecurityXcode error “Could not find Developer Disk Image”
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
When I use Xcode for C++ to edit a simple demo that is simulating a process, it gives an error:
Undefined symbols for architecture x86_64:
"exit()", referenced from:
menu() in main.o
"kill()", referenced from:
menu() in main.o
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my limited experience with C++, I have never meet this problem, and I search for long time on net, but have no use.please help or try to give me some ideas how to achieve this. Thanks in advance.
My Xcode version is 10.1.
<!-- language: C++ -->
#include<iostream>
#include<string.h>
#include<stdlib.h>
#define OK 1
#define ERROR 0
#define OVERFLOW -2
void create();
void kill();
void display();
void exit();
struct PCB
char NAME[10];
long ID;
float TIME;
int PRIORITY;
;PCB pcb[100];
typedef struct QNode
int data;
struct QNode*next;
QNode,*QueuePtr;
typedef struct
QueuePtr front;
QueuePtr rear;
LinkQueue;LinkQueue Ready,Empty;
int InitQueue()
Ready.front=Ready.rear=new QNode;
Empty.front=Empty.rear=new QNode;
Ready.front->next=NULL;
Empty.front->next=NULL;
return OK;
void menu()
std::cout<<"****=========="<<"1. 进程创建 n";
std::cout<<"****=========="<<"2. 进程撤销 n";
std::cout<<"****=========="<<"3. 就绪队列显示 n";
std::cout<<"****=========="<<"4. 退出 n";
int choice;
std::cout<<" 请选择: ";
std::cin>>choice;
switch(choice)
case 1:create();break;
case 2:kill();break;
case 3:display();break;
case 4:exit();
void create()
char name[10];
long id;
float time;
int priority;
int n;
QNode *p;
std::cout<<" 请输入要创建进程的数目: ";
std::cin>>n;
for(int i=1;i<=n;i++)
std::cout<<" 进程 ID :"; std::cin>>id;
for(int j=i-1;j<=n;j++)
while(id==pcb[j].ID)
std::cout<<" 进程 ID 已存在 "<<std::endl;
std::cout<<" 进程 ID :"; std::cin>>id;
std::cout<<" 进程名: ";
std::cin>>name;
std::cout<<" 运行时间: ";
std::cin>>time;
std::cout<<" 优先级: ";
std::cin>>priority;
n++;// 保存当前就绪进程数
strcpy(pcb[n].NAME,name);
pcb[n].ID =id;
pcb[n].TIME =time;
pcb[n].PRIORITY =priority;
p=new QNode;// 插入就绪队列
p->data=n;
p->next=NULL;
Ready.rear->next=p;
Ready.rear=p;
for(int i=1;i<=n;i++)// 按优先级排队
for(int j=i+1;j<=n;j++)
if(pcb[i].PRIORITY<pcb[j].PRIORITY)
pcb[0]=pcb[i];
pcb[i]=pcb[j];
pcb[j]=pcb[0];
menu();
void kill(int n)// 进程终止
long id;
QNode *p,*q;
std::cout<<" 请输入要终止的进程 ID:";
std::cin>>id;
p=Ready.front->next;
if(p==NULL)
std::cout<<" 就绪进程为空! ";
while(p!=NULL)
if(id==pcb[n].ID)// 终止进程是队列最后一个
if(n==1) // 队列中只有一个进程,且是终止进程
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
Ready.front =Ready.rear;
Ready.front ->next =NULL;
n--;
std::cout<<" 进程已终止! ";
break;
else //队列中进程多个
while(p!=NULL)
if(p->next->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
n--;
std::cout<<" 进程已终止! ";
break;
p=p->next ;
if(id==pcb[p->data].ID)
if(Ready.front==Ready.rear)
std::cout<<" 队列为空 !"<< std::endl;
while(p!=NULL)
pcb[p->data]=pcb[p->data+1];// 修改 PCB 数组里的值
if(p->next ->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
std::cout<<" 进程已终止! ";
break;
p=p->next;
n--;
break;
p=p->next ;
menu();
void display()
QNode *p;
p=Ready.front->next;
std::cout<<"ID"<<" "<<" 名字 "<<" "<<" 运行时间 "<<" "<<" 优先级"<<std::endl;
while(p!=NULL)
std::cout<<pcb[p->data].ID<<""<<pcb[p->data].NAME<<""<<pcb[p->data].TIME <<""<<pcb[p->data].PRIORITY<<std::endl;
p=p->next ;
menu();
int main()
InitQueue();
pcb[0].ID =0;
menu();
c++ xcode
add a comment |
When I use Xcode for C++ to edit a simple demo that is simulating a process, it gives an error:
Undefined symbols for architecture x86_64:
"exit()", referenced from:
menu() in main.o
"kill()", referenced from:
menu() in main.o
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my limited experience with C++, I have never meet this problem, and I search for long time on net, but have no use.please help or try to give me some ideas how to achieve this. Thanks in advance.
My Xcode version is 10.1.
<!-- language: C++ -->
#include<iostream>
#include<string.h>
#include<stdlib.h>
#define OK 1
#define ERROR 0
#define OVERFLOW -2
void create();
void kill();
void display();
void exit();
struct PCB
char NAME[10];
long ID;
float TIME;
int PRIORITY;
;PCB pcb[100];
typedef struct QNode
int data;
struct QNode*next;
QNode,*QueuePtr;
typedef struct
QueuePtr front;
QueuePtr rear;
LinkQueue;LinkQueue Ready,Empty;
int InitQueue()
Ready.front=Ready.rear=new QNode;
Empty.front=Empty.rear=new QNode;
Ready.front->next=NULL;
Empty.front->next=NULL;
return OK;
void menu()
std::cout<<"****=========="<<"1. 进程创建 n";
std::cout<<"****=========="<<"2. 进程撤销 n";
std::cout<<"****=========="<<"3. 就绪队列显示 n";
std::cout<<"****=========="<<"4. 退出 n";
int choice;
std::cout<<" 请选择: ";
std::cin>>choice;
switch(choice)
case 1:create();break;
case 2:kill();break;
case 3:display();break;
case 4:exit();
void create()
char name[10];
long id;
float time;
int priority;
int n;
QNode *p;
std::cout<<" 请输入要创建进程的数目: ";
std::cin>>n;
for(int i=1;i<=n;i++)
std::cout<<" 进程 ID :"; std::cin>>id;
for(int j=i-1;j<=n;j++)
while(id==pcb[j].ID)
std::cout<<" 进程 ID 已存在 "<<std::endl;
std::cout<<" 进程 ID :"; std::cin>>id;
std::cout<<" 进程名: ";
std::cin>>name;
std::cout<<" 运行时间: ";
std::cin>>time;
std::cout<<" 优先级: ";
std::cin>>priority;
n++;// 保存当前就绪进程数
strcpy(pcb[n].NAME,name);
pcb[n].ID =id;
pcb[n].TIME =time;
pcb[n].PRIORITY =priority;
p=new QNode;// 插入就绪队列
p->data=n;
p->next=NULL;
Ready.rear->next=p;
Ready.rear=p;
for(int i=1;i<=n;i++)// 按优先级排队
for(int j=i+1;j<=n;j++)
if(pcb[i].PRIORITY<pcb[j].PRIORITY)
pcb[0]=pcb[i];
pcb[i]=pcb[j];
pcb[j]=pcb[0];
menu();
void kill(int n)// 进程终止
long id;
QNode *p,*q;
std::cout<<" 请输入要终止的进程 ID:";
std::cin>>id;
p=Ready.front->next;
if(p==NULL)
std::cout<<" 就绪进程为空! ";
while(p!=NULL)
if(id==pcb[n].ID)// 终止进程是队列最后一个
if(n==1) // 队列中只有一个进程,且是终止进程
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
Ready.front =Ready.rear;
Ready.front ->next =NULL;
n--;
std::cout<<" 进程已终止! ";
break;
else //队列中进程多个
while(p!=NULL)
if(p->next->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
n--;
std::cout<<" 进程已终止! ";
break;
p=p->next ;
if(id==pcb[p->data].ID)
if(Ready.front==Ready.rear)
std::cout<<" 队列为空 !"<< std::endl;
while(p!=NULL)
pcb[p->data]=pcb[p->data+1];// 修改 PCB 数组里的值
if(p->next ->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
std::cout<<" 进程已终止! ";
break;
p=p->next;
n--;
break;
p=p->next ;
menu();
void display()
QNode *p;
p=Ready.front->next;
std::cout<<"ID"<<" "<<" 名字 "<<" "<<" 运行时间 "<<" "<<" 优先级"<<std::endl;
while(p!=NULL)
std::cout<<pcb[p->data].ID<<""<<pcb[p->data].NAME<<""<<pcb[p->data].TIME <<""<<pcb[p->data].PRIORITY<<std::endl;
p=p->next ;
menu();
int main()
InitQueue();
pcb[0].ID =0;
menu();
c++ xcode
1
Can you please add the code you've tried to the question?
– C. Peck
Mar 22 at 4:53
add a comment |
When I use Xcode for C++ to edit a simple demo that is simulating a process, it gives an error:
Undefined symbols for architecture x86_64:
"exit()", referenced from:
menu() in main.o
"kill()", referenced from:
menu() in main.o
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my limited experience with C++, I have never meet this problem, and I search for long time on net, but have no use.please help or try to give me some ideas how to achieve this. Thanks in advance.
My Xcode version is 10.1.
<!-- language: C++ -->
#include<iostream>
#include<string.h>
#include<stdlib.h>
#define OK 1
#define ERROR 0
#define OVERFLOW -2
void create();
void kill();
void display();
void exit();
struct PCB
char NAME[10];
long ID;
float TIME;
int PRIORITY;
;PCB pcb[100];
typedef struct QNode
int data;
struct QNode*next;
QNode,*QueuePtr;
typedef struct
QueuePtr front;
QueuePtr rear;
LinkQueue;LinkQueue Ready,Empty;
int InitQueue()
Ready.front=Ready.rear=new QNode;
Empty.front=Empty.rear=new QNode;
Ready.front->next=NULL;
Empty.front->next=NULL;
return OK;
void menu()
std::cout<<"****=========="<<"1. 进程创建 n";
std::cout<<"****=========="<<"2. 进程撤销 n";
std::cout<<"****=========="<<"3. 就绪队列显示 n";
std::cout<<"****=========="<<"4. 退出 n";
int choice;
std::cout<<" 请选择: ";
std::cin>>choice;
switch(choice)
case 1:create();break;
case 2:kill();break;
case 3:display();break;
case 4:exit();
void create()
char name[10];
long id;
float time;
int priority;
int n;
QNode *p;
std::cout<<" 请输入要创建进程的数目: ";
std::cin>>n;
for(int i=1;i<=n;i++)
std::cout<<" 进程 ID :"; std::cin>>id;
for(int j=i-1;j<=n;j++)
while(id==pcb[j].ID)
std::cout<<" 进程 ID 已存在 "<<std::endl;
std::cout<<" 进程 ID :"; std::cin>>id;
std::cout<<" 进程名: ";
std::cin>>name;
std::cout<<" 运行时间: ";
std::cin>>time;
std::cout<<" 优先级: ";
std::cin>>priority;
n++;// 保存当前就绪进程数
strcpy(pcb[n].NAME,name);
pcb[n].ID =id;
pcb[n].TIME =time;
pcb[n].PRIORITY =priority;
p=new QNode;// 插入就绪队列
p->data=n;
p->next=NULL;
Ready.rear->next=p;
Ready.rear=p;
for(int i=1;i<=n;i++)// 按优先级排队
for(int j=i+1;j<=n;j++)
if(pcb[i].PRIORITY<pcb[j].PRIORITY)
pcb[0]=pcb[i];
pcb[i]=pcb[j];
pcb[j]=pcb[0];
menu();
void kill(int n)// 进程终止
long id;
QNode *p,*q;
std::cout<<" 请输入要终止的进程 ID:";
std::cin>>id;
p=Ready.front->next;
if(p==NULL)
std::cout<<" 就绪进程为空! ";
while(p!=NULL)
if(id==pcb[n].ID)// 终止进程是队列最后一个
if(n==1) // 队列中只有一个进程,且是终止进程
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
Ready.front =Ready.rear;
Ready.front ->next =NULL;
n--;
std::cout<<" 进程已终止! ";
break;
else //队列中进程多个
while(p!=NULL)
if(p->next->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
n--;
std::cout<<" 进程已终止! ";
break;
p=p->next ;
if(id==pcb[p->data].ID)
if(Ready.front==Ready.rear)
std::cout<<" 队列为空 !"<< std::endl;
while(p!=NULL)
pcb[p->data]=pcb[p->data+1];// 修改 PCB 数组里的值
if(p->next ->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
std::cout<<" 进程已终止! ";
break;
p=p->next;
n--;
break;
p=p->next ;
menu();
void display()
QNode *p;
p=Ready.front->next;
std::cout<<"ID"<<" "<<" 名字 "<<" "<<" 运行时间 "<<" "<<" 优先级"<<std::endl;
while(p!=NULL)
std::cout<<pcb[p->data].ID<<""<<pcb[p->data].NAME<<""<<pcb[p->data].TIME <<""<<pcb[p->data].PRIORITY<<std::endl;
p=p->next ;
menu();
int main()
InitQueue();
pcb[0].ID =0;
menu();
c++ xcode
When I use Xcode for C++ to edit a simple demo that is simulating a process, it gives an error:
Undefined symbols for architecture x86_64:
"exit()", referenced from:
menu() in main.o
"kill()", referenced from:
menu() in main.o
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
In my limited experience with C++, I have never meet this problem, and I search for long time on net, but have no use.please help or try to give me some ideas how to achieve this. Thanks in advance.
My Xcode version is 10.1.
<!-- language: C++ -->
#include<iostream>
#include<string.h>
#include<stdlib.h>
#define OK 1
#define ERROR 0
#define OVERFLOW -2
void create();
void kill();
void display();
void exit();
struct PCB
char NAME[10];
long ID;
float TIME;
int PRIORITY;
;PCB pcb[100];
typedef struct QNode
int data;
struct QNode*next;
QNode,*QueuePtr;
typedef struct
QueuePtr front;
QueuePtr rear;
LinkQueue;LinkQueue Ready,Empty;
int InitQueue()
Ready.front=Ready.rear=new QNode;
Empty.front=Empty.rear=new QNode;
Ready.front->next=NULL;
Empty.front->next=NULL;
return OK;
void menu()
std::cout<<"****=========="<<"1. 进程创建 n";
std::cout<<"****=========="<<"2. 进程撤销 n";
std::cout<<"****=========="<<"3. 就绪队列显示 n";
std::cout<<"****=========="<<"4. 退出 n";
int choice;
std::cout<<" 请选择: ";
std::cin>>choice;
switch(choice)
case 1:create();break;
case 2:kill();break;
case 3:display();break;
case 4:exit();
void create()
char name[10];
long id;
float time;
int priority;
int n;
QNode *p;
std::cout<<" 请输入要创建进程的数目: ";
std::cin>>n;
for(int i=1;i<=n;i++)
std::cout<<" 进程 ID :"; std::cin>>id;
for(int j=i-1;j<=n;j++)
while(id==pcb[j].ID)
std::cout<<" 进程 ID 已存在 "<<std::endl;
std::cout<<" 进程 ID :"; std::cin>>id;
std::cout<<" 进程名: ";
std::cin>>name;
std::cout<<" 运行时间: ";
std::cin>>time;
std::cout<<" 优先级: ";
std::cin>>priority;
n++;// 保存当前就绪进程数
strcpy(pcb[n].NAME,name);
pcb[n].ID =id;
pcb[n].TIME =time;
pcb[n].PRIORITY =priority;
p=new QNode;// 插入就绪队列
p->data=n;
p->next=NULL;
Ready.rear->next=p;
Ready.rear=p;
for(int i=1;i<=n;i++)// 按优先级排队
for(int j=i+1;j<=n;j++)
if(pcb[i].PRIORITY<pcb[j].PRIORITY)
pcb[0]=pcb[i];
pcb[i]=pcb[j];
pcb[j]=pcb[0];
menu();
void kill(int n)// 进程终止
long id;
QNode *p,*q;
std::cout<<" 请输入要终止的进程 ID:";
std::cin>>id;
p=Ready.front->next;
if(p==NULL)
std::cout<<" 就绪进程为空! ";
while(p!=NULL)
if(id==pcb[n].ID)// 终止进程是队列最后一个
if(n==1) // 队列中只有一个进程,且是终止进程
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
Ready.front =Ready.rear;
Ready.front ->next =NULL;
n--;
std::cout<<" 进程已终止! ";
break;
else //队列中进程多个
while(p!=NULL)
if(p->next->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
n--;
std::cout<<" 进程已终止! ";
break;
p=p->next ;
if(id==pcb[p->data].ID)
if(Ready.front==Ready.rear)
std::cout<<" 队列为空 !"<< std::endl;
while(p!=NULL)
pcb[p->data]=pcb[p->data+1];// 修改 PCB 数组里的值
if(p->next ->next ==NULL)
q=new QNode;
q->data=Ready.rear->data;
Empty.rear->next=p;
Empty.rear=p;
p->next =NULL;
Ready.rear =p;
std::cout<<" 进程已终止! ";
break;
p=p->next;
n--;
break;
p=p->next ;
menu();
void display()
QNode *p;
p=Ready.front->next;
std::cout<<"ID"<<" "<<" 名字 "<<" "<<" 运行时间 "<<" "<<" 优先级"<<std::endl;
while(p!=NULL)
std::cout<<pcb[p->data].ID<<""<<pcb[p->data].NAME<<""<<pcb[p->data].TIME <<""<<pcb[p->data].PRIORITY<<std::endl;
p=p->next ;
menu();
int main()
InitQueue();
pcb[0].ID =0;
menu();
c++ xcode
c++ xcode
edited Mar 22 at 10:43
inking
asked Mar 22 at 4:30
inkinginking
12
12
1
Can you please add the code you've tried to the question?
– C. Peck
Mar 22 at 4:53
add a comment |
1
Can you please add the code you've tried to the question?
– C. Peck
Mar 22 at 4:53
1
1
Can you please add the code you've tried to the question?
– C. Peck
Mar 22 at 4:53
Can you please add the code you've tried to the question?
– C. Peck
Mar 22 at 4:53
add a comment |
1 Answer
1
active
oldest
votes
I see:
void kill();
void exit();
declared at the top of your C++ file when you actually have the code defined as:
void kill(int n)// 进程终止
{
...
...
Change your declaration at the top of your C++ file to match what your code looks like. And whenever you call kill in your code, pass in 1 or whatever you want n to be (e.g. kill(1)).
Also, unlike kill, exit() already exists in C++ and you should remove that declaration from the top of your code and whenever you call it, use something like exit(0).
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55292943%2fhow-do-you-use-xcode-to-edit-a-cpp-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I see:
void kill();
void exit();
declared at the top of your C++ file when you actually have the code defined as:
void kill(int n)// 进程终止
{
...
...
Change your declaration at the top of your C++ file to match what your code looks like. And whenever you call kill in your code, pass in 1 or whatever you want n to be (e.g. kill(1)).
Also, unlike kill, exit() already exists in C++ and you should remove that declaration from the top of your code and whenever you call it, use something like exit(0).
add a comment |
I see:
void kill();
void exit();
declared at the top of your C++ file when you actually have the code defined as:
void kill(int n)// 进程终止
{
...
...
Change your declaration at the top of your C++ file to match what your code looks like. And whenever you call kill in your code, pass in 1 or whatever you want n to be (e.g. kill(1)).
Also, unlike kill, exit() already exists in C++ and you should remove that declaration from the top of your code and whenever you call it, use something like exit(0).
add a comment |
I see:
void kill();
void exit();
declared at the top of your C++ file when you actually have the code defined as:
void kill(int n)// 进程终止
{
...
...
Change your declaration at the top of your C++ file to match what your code looks like. And whenever you call kill in your code, pass in 1 or whatever you want n to be (e.g. kill(1)).
Also, unlike kill, exit() already exists in C++ and you should remove that declaration from the top of your code and whenever you call it, use something like exit(0).
I see:
void kill();
void exit();
declared at the top of your C++ file when you actually have the code defined as:
void kill(int n)// 进程终止
{
...
...
Change your declaration at the top of your C++ file to match what your code looks like. And whenever you call kill in your code, pass in 1 or whatever you want n to be (e.g. kill(1)).
Also, unlike kill, exit() already exists in C++ and you should remove that declaration from the top of your code and whenever you call it, use something like exit(0).
answered Mar 22 at 11:00
Michael DautermannMichael Dautermann
81.1k15135171
81.1k15135171
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55292943%2fhow-do-you-use-xcode-to-edit-a-cpp-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you please add the code you've tried to the question?
– C. Peck
Mar 22 at 4:53