我正在寻找一个可以与其他人合作的IDE.我想进行实时编辑和颜色协调(这意味着如果Bob在线并且更改了一些代码,那么它将更改他的更改,类似于在Google上共享文档).
我试过通过谷歌搜索,但我找不到任何真正符合我需求的东西.我现在是一名大学生,并且有与其他同学一起做的项目,但使用Pastebin有点麻烦,因为我必须打开IDE +网络浏览器,然后复制粘贴,分享等.
有没有可以通过实时协作为C/C++,C#,.Net等编译的IDE?如果我必须在桌面上设置服务器以使其正常工作,那么我没有遇到任何问题
我被困在一些没有评分的作业上(这意味着练习).
我必须创建一个带有find_name2个参数的函数.第一个参数是名称(字符串)的二维数组,第二个参数是用于在二维数组中查找名称的字符串,如果找到其他0,则函数必须返回1.
当我调用该函数(现在为空)时,我得到了这个 warning: passing argument 1 of 'find_name' from incompatible pointer type
这是重要的一点.
在主要
char strNameList[][2] = { { "Luca","Daniel"} ,{"Vivan","Desmond"},{"Abdul","Justin"}, {"Nina","Marlene"},{"Donny","Kathlene"} };
char strFindName[] = "\0";
printf("Please enter a name to look for: ");
gets(strFindName);
nSearch = find_name(strNameList, strFindName);
Run Code Online (Sandbox Code Playgroud)
功能
int find_name(char strNameList[][2], char strLookUp[])
Run Code Online (Sandbox Code Playgroud)
我是C的新手(我是学生),我对字符串(字符串数组等)感到困惑.
double cost_factor(int num_of_sections, int num_of_students) {
double cost;
cost = 35 * num_of_sections / num_of_students;
printf("Cost = %.2lf\n", cost);
return cost;
}
Run Code Online (Sandbox Code Playgroud)
无论我为num_of_sections和num_of_students输入什么,我得到的返回值为1.00.如果我输入11(num_of_sections)和364(num_of_students),我得到1.00,但是它应该是1.06.有谁能识别他们的错误?
我被困在一个我必须写的程序上.
基本上它会询问用户一个角色,以及他们喜欢该角色的显示次数.每行只有10个字符.我无法弄清楚如何停在10然后继续下一行.
示例输出:
Enter a character: *
Enter the number of characters to display: 36
**********
**********
Run Code Online (Sandbox Code Playgroud)
我目前正在使用For循环.
编辑**我的代码
main () {
int num = 0,i;
char get_char;
printf("Enter a character: ");
scanf("%c", &get_char);
printf("Enter the number of characters to display: ");
scanf("%d", &num);
for (i = 0;i < num; i++) {
printf("%.10c",get_char);
i++;
}
}
Run Code Online (Sandbox Code Playgroud) char again;
do {
counter = 0;
while (counter < 3) {
printf("Please enter a number: ");
scanf("%d", &num);
counter++;
sum += num;
}
if (counter == 3) {
printf("Would you like to continue? [Y]Yes [N]No:");
scanf("%c", &again);
}
}while (again == 'Y');
Run Code Online (Sandbox Code Playgroud)
我似乎无法弄清楚为什么这不起作用.如果我输入Y则会中断,如果我输入N则会中断.我需要循环,直到用户输入"N"退出程序而没有其他字母.
我遇到了下面粘贴的代码问题,它只是在运行时挂起.VS2010没有给我任何警告或错误.
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
void clear_buffer(void)
{
while(getchar() != '\n');
}
int validate(int low, int high) {
int num;
scanf("%d", &num);
while(num < low || num > high)
{
clear_buffer();
printf("INVALID! Must enter value between %d and %d: ", low, high);
scanf("%d", &num);
}
return num;
}
int getRand(int max) {
int number;
number = rand() % max + 1;
return number;
}
int validatePick(int pick, int one, int two, int three, int four, int five) { …Run Code Online (Sandbox Code Playgroud)