小编Luc*_*vin的帖子

在C中查找字符串数组中的唯一元素

C困扰我对弦乐的处理.我心中有这样的伪代码:

char *data[20]; 

char *tmp; int i,j;

for(i=0;i<20;i++) {
  tmp = data[i]; 
  for(j=1;j<20;j++) 
  {
    if(strcmp(tmp,data[j]))
      //then except the uniqueness, store them in elsewhere
  }
}
Run Code Online (Sandbox Code Playgroud)

但是当我对此进行编码时,结果很糟糕.(我处理了所有内存,小东西等)问题显然在第二个循环中:D.但我想不出任何解决方案.如何在数组中找到唯一的字符串.

输入示例:abc def abe abc def deg输入唯一的输入:应找到abc def abe deg.

c arrays string strcmp

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

C中有调节背景颜色的函数吗?(实际上是一个Dos命令)

我正在寻找调整背景颜色的系统功能。它就像

system("color",somecolorcodes);

有人知道吗?

在 Windows XP 或 7 上!

c colors

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

标签 统计

c ×2

arrays ×1

colors ×1

strcmp ×1

string ×1