小编Chr*_*_45的帖子

从Windows中的命令提示符编译C代码?

我想从Windows中的命令提示符编译C代码.我已将环境变量添加到PATH中,我可以使用以下命令编译.cs文件:csc app.cs

没关系,但是如何编译app.c?

c windows compilation prompt visual-studio

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

从C到面向对象编程的最佳学习路径?

如果在C中做了一些编程,那么学习OOP的最佳途径是什么?

我的意图是首先采取自然的飞跃,并"与一个增量",然后去Stroustrup.但是,因为我得到了小老Bertrand Meyer的OOSC2,并且我从附录第1135页开始说道."根据Donald Knuth的说法,这会让Edsger Dijkstra身体不适,想到用C++编程" 和Meyer本人"...... C++不是理想的OOP语言......"

那么关于C++在这个问题上的批评是什么:对C++的批评

如果我的意图是对现代OOP语言的深刻理解,我是否应该跳过C++并直接使用C#和Java?或者我是否会错过C++中关于此主题的优点?

嗯,我知道这是一个讨论的事情,但我把它标记为wiki,你的答案对我来说可能意味着很多选择.

c# c++ java oop

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

对于旧的(类似C的)fscanf方法,现代等价(C++)样式是什么?

如果我想在使用分号分隔符读取文件时将旧C代码"升级"为更新的C++,那么最佳选择是什么:

/* reading in from file C-like: */
fscanf(tFile, "%d", &mypost.nr); /*delimiter ; */
fscanf(tFile, " ;%[^;];", mypost.aftername);/* delimiter ; */
fscanf(tFile, " %[^;]", mypost.forename);   /*delimiter ; */
fscanf(tFile, " ;%[^;];", mypost.dept);/*delimiter ; */
fscanf(tFile, " %[^;];", mypost.position);/* delimiter ; */
fscanf(tFile, "%d", &mypost.nr2);

//eqivalent best C++ method achieving the same thing?
Run Code Online (Sandbox Code Playgroud)

c c++ scanf

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

学习C++的视频课程

您是否对优秀视频课程有任何建议,作为学习C++书籍的补充?

c++

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

Win 32平台上的Netbeans的几个实例

是否可以运行多个Netbeans实例,就像在Win 32平台上使用Visual Studio一样?我可以点一个.

java ide netbeans windows-vista

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

Sourceannotations.h?C++

Visual Studio 2008中的错误消息是什么?

Error 1 error C2144: syntax error : '__w64 unsigned int' should be preceded by ';' c:\program files\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h 19 Steg2_Labs
Run Code Online (Sandbox Code Playgroud)

我自己没有任何headerfiles.

c++ visual-studio-2008

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

用C编程语言切换函数中的指针

如何在函数中切换指针?

void ChangePointers(int *p_intP1, int *p_intP2); 

int main() {

int i = 100,  j = 500;
int *intP1, *intP2; /* pointers */
intP1 = &i;
intP2 = &j;
printf("%d\n", *intP1); /* prints 100 (i) */
printf("%d\n", *intP2); /* prints 500 (j) */
ChangePointers(intP1, intP2);


printf("%d\n", *intP1); /* still prints  100, would like it swapped by now */
printf("%d\n", *intP2); /* still prints  500 would like it swapped by now */
}/* end main */

void ChangePointers(int *p_intP1, int *p_intP2) { …
Run Code Online (Sandbox Code Playgroud)

c c++ swap pointers function

7
推荐指数
3
解决办法
3949
查看次数

数组/ arrayname不是指向C中第一个元素的指针吗?

下面的内容是不是arrayname总是指向C中第一个元素的指针?

int myArray[10] = {0};

printf("%d\n", &myArray); /* prints memadress for first element */
printf("%d\n", myArray); /* this prints a memadress too, shows that the name is a pointer */

printf("%d\n",sizeof(myArray)); /* this prints size of the whole array, not a pointer anymore? */
printf("%d\n",sizeof(&myArray)); /* this prints the size of the pointer */
Run Code Online (Sandbox Code Playgroud)

c arrays pointers

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

使用C++中的cout在打印输出中进行绝对定位?

你如何得到cout的"绝对定位"列,左对齐文本和右对齐数字?

#include <iostream>
#include <iomanip>
using namespace std;

struct Human {
    char name[20];
    char name2[20];
    char name3[20];
    double pts;
};

int main() {
    int i;
    Human myHumen[3] = {
        {"Mr", "Alan", "Turing", 12.25},
        {"Ms", "Ada", "Lovelace", 15.25},
        {"Sir",  "Edgar Allan", "Poe", 45.25}
    };
    cout << "Name1" << setw(22) << "Name2" << setw(22) << "Name3" << setw(22) << "Rating" <<endl;
    cout << "-----------------------------------------------------------------------\n";
    for(i = 0; i < 3; i++) {
        cout << myHumen[i].name << setw(22) << myHumen[i].name2 << setw(22) << …
Run Code Online (Sandbox Code Playgroud)

c++ formatting cout

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

用C语言对字符串数组进行排序,无论是'A'还是'a',还是用å,äö?

如何在C++中对字符串数组进行排序,以便按以下顺序进行:

安卡先生

布朗先生

塞瑟先生

mR donK

先生

Ätt先生

先生

//following not the way to get that order regardeless upper or lowercase and å, ä, ö
//in forloop... 
string handle;
point1 = array1[j].find_first_of(' ');
string forename1(array1[j].substr(0, (point1)));
string aftername1(array1[j].substr(point1 + 1));
point2 = array1[j+1].find_first_of(' ');
string forename2(array1[j+1].substr(0, (point2)));
string aftername2(array1[j+1].substr(point2 + 1));
if(aftername1 > aftername2){
    handle = array1[j];
    array1[j] = array1[j+1];
    array1[j+1] = handle;//swapping
}
if(aftername1 == aftername2){
    if(forname1 > forname2){
        handle = array1[j];
        array1[j] = array1[j+1];
        array1[j+1] = handle;   
    } …
Run Code Online (Sandbox Code Playgroud)

c++ arrays sorting string

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