我正在使用powershell 3.0进行培训,我正在尝试以字节为单位获取文件的内容,通过管道发送它以加入结果,因为默认情况下每行有一个字节,然后将结果发送到文件中.
这是我正在使用的命令:
get-content 'My file' -Encoding byte | $_ -join ' ' | Out-File -path 'My result file'
Run Code Online (Sandbox Code Playgroud)
总而言之,有人知道如何-join在管道之后使用?
我不知道标题是否足够清晰,所以这就是我想要做的.我想用a #define来定义struct中数组的大小.
我这样做,但它不想工作:
#ifndef DEF_MAIN
#define DEF_MAIN
#define TAILLE_TAB = 100;
typedef struct Personne Personne;
struct Personne
{
char nom[TAILLE_TAB];
char prenom[TAILLE_TAB];
int age;
};
#endif
Run Code Online (Sandbox Code Playgroud)
但是我收到了一个错误.
如果我改为:
{
char nom[100];
char prenom[100];
int age;
};
Run Code Online (Sandbox Code Playgroud)
然后它工作......
为什么第一个解决方案不起作用?=(
不能对同一文件上的代码使用#define VAR?