小编Sha*_*dra的帖子

grep-ing多个文件

我想grep目录中的多个文件,并在一个单独的文件中收集每个grep的输出.所以,如果我grep 20个文件,我应该得到20个包含搜索项目的输出文件.任何人都可以帮我吗?谢谢.

bash scripting

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

windows和linux生成的可执行文件之间有什么区别

可能重复:
为什么特定CPU的可执行程序在Linux和Windows上不起作用?

为什么用linux编写的程序不能在windows中执行?假设我编译了一个简单的C程序,其中包含对windows和linux都通用的函数调用,编译器是否在windows和linux下生成不同的二进制文件?

c linux compiler-construction

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

每N行的总和; AWK

我有一个包含单列数据的文件..我必须找到每4行的总和并打印总和即,我必须计算从第3行到第7行的0-3行总和的值之和,总和第8到11行等等......

scripting awk

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

帮助您使用awk选择行

我有一个文件如下

  • 2.54 Ghz val
  • 2.53 Ghz val1
  • 1.6 Ghz val2
  • 800 Mhz val3
  • 2.54 Ghz val4
  • 2.53 Ghz val5
  • 1.6 Ghz val6
  • 800 Mhz val7

模式继续...我想提取一个文件1中的所有2.54 Ghz值和另一个文件2中的所有2.53 Ghz值,file3中的1.60 Ghz值和file4中的800 Mhz值

谁能帮我这个 ?

bash scripting awk

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

从文件中选择偶数行

如何选择文件的偶数行?我希望从包含数据的文件中选择行#2,4,6等.谁能帮我这个?

bash scripting

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

如何从main()调用线程成员函数

我在编译使用线程的程序时遇到错误.这是导致问题的部分.如果有人告诉我是否以正确的方式调用线程函数,那将会很好.

在main.cpp中:

int main() 
{
    WishList w;
    boost::thread thrd(&w.show_list);
    thrd.join();
}
Run Code Online (Sandbox Code Playgroud)

在another_file.cpp中:

class WishList{
public:
      void show_list();
}

void WishList::show_list(){
        .
        .
        .
        .
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

error: ISO C++ forbids taking the address of a bound member function to form a pointer to member function.  Say ‘&WishList::show_list’

/home/sharatds/Downloads/boost_1_46_1/boost/thread/detail/thread.hpp: In member function ‘void boost::detail::thread_data<F>::run() [with F = void (WishList::*)()]’:

/home/sharatds/Downloads/boost_1_46_1/boost/thread/detail/thread.hpp:61:17: error: must use ‘.*’ or ‘->*’ to call pointer-to-member function in ‘((boost::detail::thread_data<void (WishList::*)()>*)this)->boost::detail::thread_data<void (WishList::*)()>::f (...)’, e.g. ‘(... ->* ((boost::detail::thread_data<void (WishList::*)()>*)this)->boost::detail::thread_data<void (WishList::*)()>::f) …
Run Code Online (Sandbox Code Playgroud)

c++ boost-thread

0
推荐指数
1
解决办法
1245
查看次数

标签 统计

scripting ×4

bash ×3

awk ×2

boost-thread ×1

c ×1

c++ ×1

compiler-construction ×1

linux ×1