小编asv*_*kau的帖子

构建一个窗口管理器

我的一个新的家庭项目将是一个简单的窗口管理器,但在开始之前我需要知道一些事情:

  • 哪个是最好的语言?
  • 哪里可以学到一些资源?

linux x11 window-managers

45
推荐指数
5
解决办法
3万
查看次数

如何使用c语言在framebuffer中绘制图形..?

我是这个linux framebuffer的新手,所以有人引导我在framebuffer中绘制线图.我有代码在turbo c中绘制图形但现在在linux中.所以请帮帮我.

谢谢你,拉胡尔

c c++ linux framebuffer

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

开始游戏开发

我想开始游戏开发.我读了很多文章,但没有走得太远.我正在学习计算机科学并且具有C++经验,一个学期的Java,.NET,(甚至是汇编程序,但我不会从那开头^^)

我想开发像"俄罗斯方块"这样的"小型"游戏,然后再进行某种跳跃和跑步.

我想使用视觉方面("游戏GUI").

我读了很多意见,但我不知道是从C++,C#,Java开始,我还读过有关DirectX和Flash的内容.(我学习一门新语言没有问题.)

我没有找到很好的教程.

- >哪种语言,教程?

提前致谢,

Tyzak

language-agnostic

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

没有UI的C#程序

是否可以制作一个没有控制台或Windows窗体运行的Visual C#程序?如果是这样,怎么样?

c#

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

使用具有作用于函数内部的匿名类的模板

假设我有以下代码段:

template <class T> void f(T arg) { arg(); }

void g()
{
   struct { void operator()(void) { } } foo;

   f(foo);
}
Run Code Online (Sandbox Code Playgroud)

Visual C++接受这个.但是,当我尝试GCC时,我得到:

$ g++ --version # just in case this matters
g++ (Debian 4.4.5-8) 4.4.5
...
$ g++ foo.cc
foo.cc: In function 'void g()':
foo.cc:7: error: no matching function for call to 'f(g()::<anonymous struct>&)'
Run Code Online (Sandbox Code Playgroud)

foo全局作用域并且其类型具有名称时,这是有效的.但是当类型是匿名的在内部声明时g()它不会.

为什么GCC拒绝这个?它是有效的C++吗?

c++ templates anonymous-class

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

有和没有斜杠

我将如何制定此规则,以便您可以使用和不使用斜杠来访问它?

RewriteRule ^members/([^/]+)$ members.php?id=$1 [L]
Run Code Online (Sandbox Code Playgroud)

regex mod-rewrite

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

简单的C++文件流

我想读取然后将文件的内容存储在数组中,但这不起作用:

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
    string content,line,fname;
    cout<<"Execute: ";
    cin>>fname;
    cin.ignore();
    cout<<endl;
    //Doesn't work:
    ifstream myfile(fname);
    if(!myfile.is_open()){
        cout<<"Unable to open file"<<endl; 
    }else{
        while(!myfile.eof()){
            getline(myfile,line);
            //I don't know how to insert the line in the string
        }
        myfile.close();
    }
    cin.get();

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++ file stream

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