- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在为 C 中的 Round Robin 调度算法制作一个模拟器。现在我做的时间片是 2。所以每 2 秒它从列表的前面开始一个“进程”,减少它的剩余时间2,然后将其粘贴到列表的末尾并获取下一个。此外,每一秒,它都会将其他人的等待时间增加 1。但是,当我尝试在函数 round_Robin()
,它删除它。但它不会将其附加到链表的末尾。我究竟做错了什么?谢谢你!我这样使用命令行参数:
./a.out input.dat text.txt 5 0.4
这是我的input.dat
:
1 0 10 50
2 2 0 40
3 3 20 50
4 4 7 35
5 5 10 50
6 6 0 40
7 7 20 50
8 9 7 35
9 10 10 50
10 12 0 40
这是我的代码:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define n 10
char *cRR;//get the argument for RR time
char *calpha;//get the argument for alpha
int full[40];
int arraylength;
int RR;//to hold RR time as an int
int i=0;//used to count amount of numbers in test file
double alpha;//hold alpha time as a double
int at[n];
int global_timer=-1;
typedef int LL_pid; // the pid of the PCB
typedef int LL_AT;//the arrival time of the pcb
typedef int LL_priority;//the priority of that PCB
typedef int LL_BT;//the Burst time of that PCB
typedef int LL_remainingtime;
typedef int LL_wT;
typedef struct LL PCB; //the PCB
struct LL //linked list structure(pcb)
{
LL_pid pid;
LL_AT AT;
LL_priority priority;
LL_BT BT;
LL_remainingtime RT;
LL_wT wT;
PCB *next;//points to next pcb in linked list
};
struct job//used for job queue
{
int pid2;
int AT2;
int priority2;
int BT2;
};
int LL_length(PCB *pcb_head); //linked list length
void LL_add(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT, LL_remainingtime RRT,LL_wT wTT); //adds PCB to front of list
void LL_pop(PCB **pcb_head); //removes the head from the list & returns its value
void LL_print(PCB **pcb_head); //prints all the processes
void LL_clear(PCB **pcb_head); //deletes all the processes from queue
void LL_append(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT,LL_remainingtime RRT,LL_wT wTT); //adds a process to the end of the list
int LL_elem(PCB **pcb_head, LL_pid d); //checks for the pcb via pid
void add_jobs(int jobss[]);
struct job jobs[n];//contains all the jobs an array
void counter(PCB **pcb_head);
void round_Robin(PCB **pcb_head);
int main ( int argc, char *argv[] )
{
PCB *pcb_head=NULL;
//*****START COMMAND LINE ARGS
if ( argc != 5 )//if they incorrectly inputed arguments
{
/* We print argv[0] assuming it is the program name */
printf( "usage: %s filename, output file name, RR quantum as a int, Alpha value as a float", argv[0] );
}
else
{
cRR=argv[3];//get arg for RR time
calpha=argv[4];//get arg for alpha
alpha=atof(calpha);//convert alpha to float
RR=atoi(cRR);//convert RR to int
// We assume argv[1] is a filename to open
FILE *file = fopen( argv[1], "r" );//open file which is 2nd arg
// fopen returns 0, the NULL pointer, on failure
if ( file == 0 )
{
printf( "Could not open file\n" );
} else
{
int y=0;//used for while loop below
while ( fscanf(file,"%d",&y)!=EOF )//scan file and find all the numbers
{
full[i]=y;//insert the numbers into an array
i++;
}
fclose( file );//done using the file
}
/*TEST PRINTING EVERYTHING IN FILE
int testprint=0;
for(testprint=0;testprint<i;testprint++){printf("%d\n",full[testprint]);}
printf("\nend of array check");*/
//write to file
FILE *fp;
fp = fopen(argv[2], "w+");
fprintf(fp, "This is testing for fprintf...\n");
fclose(fp);
}
/////////////////END OF COMMAND ARGUMENT THINGS
add_jobs(full);//adds all inputs from file to the array "jobs"
counter(&pcb_head);
round_Robin(&pcb_head);
/*
//example usage:
LL_add(&pcb_head, 7,7,7,7,10); //push value 7 onto stack
printf("%d\n", pcb_head -> pid); //show stack head value
LL_add(&pcb_head, 21,21,21,21,31); //push value 21 onto stack
LL_print(&pcb_head); //print the stack
if(LL_elem(&pcb_head, 7)) puts("found 7"); //does 7 belong to the stack?
LL_append(&pcb_head, 0,0,0,0,50); //append 0 to the end of the stack
LL_print(&pcb_head); //print the stack
LL_pop(&pcb_head); //pop the stack's head
LL_print(&pcb_head); //print the stack
LL_clear(&pcb_head); //clear the stack
LL_print(&pcb_head); //print the stack
*/
getchar();
return 0;
}
int LL_length(PCB *pcb_head)
{
PCB *curr = pcb_head;//set a temp value to the head
int len = 0;
while(curr)
{
++len;//increase length variable
curr = curr -> next;//go to next and keep looping to get whole length
}
return len;
}
void LL_add(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT, LL_remainingtime RRT, LL_wT wTT)
{
PCB *pcb_new = malloc(sizeof(PCB));//allocate memory for another structure (PCB)
pcb_new -> pid = ppid;//create a pcb with pid inserted
pcb_new -> AT = AAT;
pcb_new -> priority = ppriority;
pcb_new -> BT = BBT;
pcb_new -> RT = RRT;
pcb_new -> wT = wTT;
pcb_new -> next = *pcb_head;//set its next to the head(inserting in front of list)
*pcb_head = pcb_new;//set the pointer of head to it since it is in front of list now
}
void LL_pop(PCB **pcb_head)
{
PCB *pcb_temp = *pcb_head;
printf("\nProcess %d is terminating\n", pcb_temp->pid);
*pcb_head = pcb_temp -> next;
free(pcb_temp);
}
void LL_print(PCB **pcb_head)
{
PCB *pcb_temp = *pcb_head;
if(!pcb_temp)
puts("the list is empty");
else
{
// while(pcb_temp)
//{
printf("Process %d has terminated...", pcb_temp -> pid);// print all the pids
// printf("%d ", pcb_temp -> AT);
// printf("%d ", pcb_temp -> priority);
// printf("%d ", pcb_temp -> BT);
//pcb_temp = pcb_temp -> next;//loop to next pcb*/
//}
putchar('\n');
}
}
void LL_clear(PCB **pcb_head)
{
while(*pcb_head)//this will get every pcb as pop below sets head value to next after deleting it
LL_pop(pcb_head);
}
void LL_append(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT, LL_remainingtime RRT,LL_wT wTT)
{
PCB *pcb_temp = *pcb_head;//get head value
if(!pcb_temp)//if nothing in head value just add the pcb as list is empty
LL_add(pcb_head, ppid, AAT, ppriority, BBT, RRT, wTT);
else
{
while(pcb_temp -> next)//get the last pcb
pcb_temp = pcb_temp -> next;
LL_add(&(pcb_temp -> next), ppid, AAT, ppriority, BBT, RRT, wTT);//add it onto the last
}
}
void add_jobs(int jobss[]){
int i = 0;
int i2 = 1;
int i3 = 2;
int i4 = 3;
int x =0;
int x2=0;
int x3=0;
int x4=0;
while(x<10){
jobs[x].pid2=jobss[i];
x++;
i+=4;
}
while(x2<10){
jobs[x2].AT2=jobss[i2];
i2+=4;
x2++;
}
while(x3<10){
jobs[x3].priority2=jobss[i3];
i3+=4;
x3++;
}
while(x4<10){
jobs[x4].BT2=jobss[i4];
i4+=4;
x4++;
}
arraylength=x4;
}
//NEED TO CHANGE 2 TO THE REAL ROUND BOBIN QUANTUM, NEED TO ADD IF RT IS LESS THEN QUANTUM, THEN PRINT FOR RT
void round_Robin(PCB **pcb_head){
PCB *pcb_temp = *pcb_head;
PCB *next = (*pcb_head)->next;//get the next value since it will be the next head
int x;
//store all the heads values
int storepid = pcb_temp->pid;
int storeat = pcb_temp->AT;
int storepriority=pcb_temp->priority;
int storebt=pcb_temp->BT;
int storert=pcb_temp->RT;
int storewt=pcb_temp->wT;
for (x=0;x<100;x++){
if(*pcb_head){
int h=0;
for(h=0;h<2;h++){//2 is represented as the time quantum right now
printf("\nProcess %d is running", (*pcb_head)->pid);
counter(pcb_head);//even tho this increases wt we already stored original wt in storewt
}
LL_pop(pcb_head);//get rid of it from head
storert-=2;//its remaining time decreases
LL_append(&next,storepid,storeat,storepriority,storebt,storert,storewt);//append it to the list
}
else{
printf("....");
counter(pcb_head);}//run counter and see if any new processes
}
}
void counter(PCB **pcb_head){
int locator;
PCB *pcb_temp = *pcb_head;
global_timer++;//increase the time
printf("\nTIME %d:", global_timer);
for(locator=0;locator<10;locator++){
if (jobs[locator].AT2==global_timer){//see if any processes are ready to enter the ready queue linked list
LL_append(pcb_head,jobs[locator].pid2,jobs[locator].AT2,jobs[locator].priority2,jobs[locator].BT2,jobs[locator].BT2,0); }
}
while(pcb_temp){
pcb_temp-> wT +=1;//increase everyones waiting time in the linked list ready queue
pcb_temp = pcb_temp->next;
}
}
int LL_elem(PCB **pcb_head, LL_pid x)
{
PCB *pcb_temp = *pcb_head;//get head
while(pcb_temp)
{
if(pcb_temp -> pid == x) //set for numbers, modifiable
return 1;
else
pcb_temp = pcb_temp -> next;
}
return 0;
}
编辑:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define n 10
char *cRR;//get the argument for RR time
char *calpha;//get the argument for alpha
int full[40];
int arraylength;
int RR;//to hold RR time as an int
int i=0;//used to count amount of numbers in test file
double alpha;//hold alpha time as a double
int at[n];
int global_timer=-1;
typedef int LL_pid; // the pid of the PCB
typedef int LL_AT;//the arrival time of the pcb
typedef int LL_priority;//the priority of that PCB
typedef int LL_BT;//the Burst time of that PCB
typedef int LL_remainingtime;
typedef int LL_wT;
typedef struct LL PCB; //the PCB
struct LL //linked list structure(pcb)
{
LL_pid pid;
LL_AT AT;
LL_priority priority;
LL_BT BT;
LL_remainingtime RT;
LL_wT wT;
PCB *next;//points to next pcb in linked list
};
struct job//used for job queue
{
int pid2;
int AT2;
int priority2;
int BT2;
};
int LL_length(PCB *pcb_head); //linked list length
void LL_add(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT, LL_remainingtime RRT,LL_wT wTT); //adds PCB to front of list
void LL_pop(PCB **pcb_head); //removes the head from the list & returns its value
void LL_print(PCB **pcb_head); //prints all the processes
void LL_clear(PCB **pcb_head); //deletes all the processes from queue
void LL_append(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT,LL_remainingtime RRT,LL_wT wTT); //adds a process to the end of the list
int LL_elem(PCB **pcb_head, LL_pid d); //checks for the pcb via pid
void add_jobs(int jobss[]);
struct job jobs[n];//contains all the jobs an array
void counter(PCB **pcb_head);
void round_Robin(PCB **pcb_head);
int main ( int argc, char *argv[] )
{
PCB *pcb_head=NULL;
//*****START COMMAND LINE ARGS
if ( argc != 5 )//if they incorrectly inputed arguments
{
/* We print argv[0] assuming it is the program name */
printf( "usage: %s filename, output file name, RR quantum as a int, Alpha value as a float", argv[0] );
}
else
{
cRR=argv[3];//get arg for RR time
calpha=argv[4];//get arg for alpha
alpha=atof(calpha);//convert alpha to float
RR=atoi(cRR);//convert RR to int
// We assume argv[1] is a filename to open
FILE *file = fopen( argv[1], "r" );//open file which is 2nd arg
// fopen returns 0, the NULL pointer, on failure
if ( file == 0 )
{
printf( "Could not open file\n" );
} else
{
int y=0;//used for while loop below
while ( fscanf(file,"%d",&y)!=EOF )//scan file and find all the numbers
{
full[i]=y;//insert the numbers into an array
i++;
}
fclose( file );//done using the file
}
/*TEST PRINTING EVERYTHING IN FILE
int testprint=0;
for(testprint=0;testprint<i;testprint++){printf("%d\n",full[testprint]);}
printf("\nend of array check");*/
//write to file
FILE *fp;
fp = fopen(argv[2], "w+");
fprintf(fp, "This is testing for fprintf...\n");
fclose(fp);
}
/////////////////END OF COMMAND ARGUMENT THINGS
add_jobs(full);//adds all inputs from file to the array "jobs"
counter(&pcb_head);
round_Robin(&pcb_head);
/*
//example usage:
LL_add(&pcb_head, 7,7,7,7,10); //push value 7 onto stack
printf("%d\n", pcb_head -> pid); //show stack head value
LL_add(&pcb_head, 21,21,21,21,31); //push value 21 onto stack
LL_print(&pcb_head); //print the stack
if(LL_elem(&pcb_head, 7)) puts("found 7"); //does 7 belong to the stack?
LL_append(&pcb_head, 0,0,0,0,50); //append 0 to the end of the stack
LL_print(&pcb_head); //print the stack
LL_pop(&pcb_head); //pop the stack's head
LL_print(&pcb_head); //print the stack
LL_clear(&pcb_head); //clear the stack
LL_print(&pcb_head); //print the stack
*/
getchar();
return 0;
}
int LL_length(PCB *pcb_head)
{
PCB *curr = pcb_head;//set a temp value to the head
int len = 0;
while(curr)
{
++len;//increase length variable
curr = curr -> next;//go to next and keep looping to get whole length
}
return len;
}
void LL_add(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT, LL_remainingtime RRT, LL_wT wTT)
{
PCB *pcb_new = malloc(sizeof(PCB));//allocate memory for another structure (PCB)
pcb_new -> pid = ppid;//create a pcb with pid inserted
pcb_new -> AT = AAT;
pcb_new -> priority = ppriority;
pcb_new -> BT = BBT;
pcb_new -> RT = RRT;
pcb_new -> wT = wTT;
pcb_new -> next = NULL;//set its next to the head(inserting in front of list)
*pcb_head = pcb_new;//set the pointer of head to it since it is in front of list now
}
void LL_pop(PCB **pcb_head)
{
PCB *pcb_temp = *pcb_head;
printf("\nProcess %d is terminating\n", pcb_temp->pid);
*pcb_head = pcb_temp -> next;
free(pcb_temp);
}
void LL_print(PCB **pcb_head)
{
PCB *pcb_temp = *pcb_head;
if(!pcb_temp)
puts("the list is empty");
else
{
// while(pcb_temp)
//{
printf("Process %d has terminated...", pcb_temp -> pid);// print all the pids
// printf("%d ", pcb_temp -> AT);
// printf("%d ", pcb_temp -> priority);
// printf("%d ", pcb_temp -> BT);
//pcb_temp = pcb_temp -> next;//loop to next pcb*/
//}
putchar('\n');
}
}
void LL_clear(PCB **pcb_head)
{
while(*pcb_head)//this will get every pcb as pop below sets head value to next after deleting it
LL_pop(pcb_head);
}
void LL_append(PCB **pcb_head,LL_pid ppid, LL_AT AAT, LL_priority ppriority, LL_BT BBT, LL_remainingtime RRT,LL_wT wTT)
{
PCB *pcb_temp = *pcb_head;//get head value
if(!pcb_temp)//if nothing in head value just add the pcb as list is empty
LL_add(pcb_head, ppid, AAT, ppriority, BBT, RRT, wTT);
else
{
while(pcb_temp -> next)//get the last pcb
pcb_temp = pcb_temp -> next;
LL_add(&(pcb_temp -> next), ppid, AAT, ppriority, BBT, RRT, wTT);//add it onto the last
}
}
void add_jobs(int jobss[]){
int i = 0;
int i2 = 1;
int i3 = 2;
int i4 = 3;
int x =0;
int x2=0;
int x3=0;
int x4=0;
while(x<10){
jobs[x].pid2=jobss[i];
x++;
i+=4;
}
while(x2<10){
jobs[x2].AT2=jobss[i2];
i2+=4;
x2++;
}
while(x3<10){
jobs[x3].priority2=jobss[i3];
i3+=4;
x3++;
}
while(x4<10){
jobs[x4].BT2=jobss[i4];
i4+=4;
x4++;
}
arraylength=x4;
}
//NEED TO CHANGE 2 TO THE REAL ROUND BOBIN QUANTUM, NEED TO ADD IF RT IS LESS THEN QUANTUM, THEN PRINT FOR RT
void round_Robin(PCB **pcb_head){
int x;
for (x=0;x<250;x++){
PCB *pcb_temp = *pcb_head;
PCB *next = (*pcb_head)->next;//get the next value since it will be the next head
int storepid = pcb_temp->pid;
int storeat = pcb_temp->AT;
int storepriority=pcb_temp->priority;
int storebt=pcb_temp->BT;
int storert=pcb_temp->RT;
int storewt=pcb_temp->wT;
if(*pcb_head){//if there is something in the list
int h=0;
if(storert>=2){//if the remaining time is greater than the quantum
for(h=0;h<2;h++){//2 is represented as the time quantum right now
printf("\nProcess %d is running", (*pcb_head)->pid);
counter(pcb_head);//even tho this increases wt we already stored original wt in storewt
//print it for the quantum
}
LL_pop(pcb_head);//get rid of it from head
storert-=2;//its remaining time decreases by the quantum
if(storert>0){//if it still has remaining time append it
LL_append(&next,storepid,storeat,storepriority,storebt,storert,storewt);}//append it to the list}
else{printf("Process has finished");}//if it doesnt type it finished
}
else{//if the remaining time is less then the quantum
for(h=0;h<storert;h++){//do it for how much is remaining
printf("\nProcess %d is running", (*pcb_head)->pid);
counter(pcb_head);
}
LL_pop(pcb_head);//get rid of it from head because it finished
printf("Process has finished");
}
}
else{
printf("....");
counter(pcb_head);}//run counter and see if any new processes
}
}
void counter(PCB **pcb_head){
int locator;
PCB *pcb_temp = *pcb_head;
global_timer++;//increase the time
printf("\nTIME %d:", global_timer);
for(locator=0;locator<10;locator++){
if (jobs[locator].AT2==global_timer){//see if any processes are ready to enter the ready queue linked list
LL_append(pcb_head,jobs[locator].pid2,jobs[locator].AT2,jobs[locator].priority2,jobs[locator].BT2,jobs[locator].BT2,0); }
}
while(pcb_temp){
pcb_temp-> wT +=1;//increase everyones waiting time in the linked list ready queue
pcb_temp = pcb_temp->next;
}
}
int LL_elem(PCB **pcb_head, LL_pid x)
{
PCB *pcb_temp = *pcb_head;//get head
while(pcb_temp)
{
if(pcb_temp -> pid == x) //set for numbers, modifiable
return 1;
else
pcb_temp = pcb_temp -> next;
}
return 0;
}
最佳答案
这段代码:
PCB *pcb_temp = *pcb_head;
PCB *next = (*pcb_head)->next;//get the next value since it will be the next head
//store all the heads values
int storepid = pcb_temp->pid;
int storeat = pcb_temp->AT;
int storepriority=pcb_temp->priority;
int storebt=pcb_temp->BT;
int storert=pcb_temp->RT;
int storewt=pcb_temp->wT;
需要在每个循环中完成,而不仅仅是在循环之前完成一次。否则,您将继续将相同的项目附加到末尾,而不是当前的头项目。
此外,LL_add()
不能用于追加到列表,因为它总是假定它是添加到头部:
pcb_new -> next = *pcb_head;
*pcb_head = pcb_new;
如果要追加到尾部,则需要如下代码:
pcb_new -> next = NULL;
*tail_ptr = pcb_new;
编辑:
LL_add()
似乎只用于附加到尾部而不是头部。在这种情况下,只需更改这一行:
pcb_new -> next = *pcb_head;
为此:
pcb_new -> next = NULL;
但是,如果您确实进行了此更改,则不要尝试使用此修改后的版本插入到头部,因为它不会起作用。
关于c - Round Robin C 调度模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29873128/
#include using namespace std; class C{ private: int value; public: C(){ value = 0;
这个问题已经有答案了: What is the difference between char a[] = ?string?; and char *p = ?string?;? (8 个回答) 已关闭
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 7 年前。 此帖子已于 8 个月
除了调试之外,是否有任何针对 c、c++ 或 c# 的测试工具,其工作原理类似于将独立函数复制粘贴到某个文本框,然后在其他文本框中输入参数? 最佳答案 也许您会考虑单元测试。我推荐你谷歌测试和谷歌模拟
我想在第二台显示器中移动一个窗口 (HWND)。问题是我尝试了很多方法,例如将分辨率加倍或输入负值,但它永远无法将窗口放在我的第二台显示器上。 关于如何在 C/C++/c# 中执行此操作的任何线索 最
我正在寻找 C/C++/C## 中不同类型 DES 的现有实现。我的运行平台是Windows XP/Vista/7。 我正在尝试编写一个 C# 程序,它将使用 DES 算法进行加密和解密。我需要一些实
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
有没有办法强制将另一个 窗口置于顶部? 不是应用程序的窗口,而是另一个已经在系统上运行的窗口。 (Windows, C/C++/C#) 最佳答案 SetWindowPos(that_window_ha
假设您可以在 C/C++ 或 Csharp 之间做出选择,并且您打算在 Windows 和 Linux 服务器上运行同一服务器的多个实例,那么构建套接字服务器应用程序的最明智选择是什么? 最佳答案 如
你们能告诉我它们之间的区别吗? 顺便问一下,有什么叫C++库或C库的吗? 最佳答案 C++ 标准库 和 C 标准库 是 C++ 和 C 标准定义的库,提供给 C++ 和 C 程序使用。那是那些词的共同
下面的测试代码,我将输出信息放在注释中。我使用的是 gcc 4.8.5 和 Centos 7.2。 #include #include class C { public:
很难说出这里问的是什么。这个问题是含糊的、模糊的、不完整的、过于宽泛的或修辞性的,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开它,visit the help center 。 已关
我的客户将使用名为 annoucement 的结构/类与客户通信。我想我会用 C++ 编写服务器。会有很多不同的类继承annoucement。我的问题是通过网络将这些类发送给客户端 我想也许我应该使用
我在 C# 中有以下函数: public Matrix ConcatDescriptors(IList> descriptors) { int cols = descriptors[0].Co
我有一个项目要编写一个函数来对某些数据执行某些操作。我可以用 C/C++ 编写代码,但我不想与雇主共享该函数的代码。相反,我只想让他有权在他自己的代码中调用该函数。是否可以?我想到了这两种方法 - 在
我使用的是编写糟糕的第 3 方 (C/C++) Api。我从托管代码(C++/CLI)中使用它。有时会出现“访问冲突错误”。这使整个应用程序崩溃。我知道我无法处理这些错误[如果指针访问非法内存位置等,
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。 关闭 7 年前。
已关闭。此问题不符合Stack Overflow guidelines 。目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,因为
我有一些 C 代码,将使用 P/Invoke 从 C# 调用。我正在尝试为这个 C 函数定义一个 C# 等效项。 SomeData* DoSomething(); struct SomeData {
这个问题已经有答案了: Why are these constructs using pre and post-increment undefined behavior? (14 个回答) 已关闭 6
我是一名优秀的程序员,十分优秀!