
我已经阅读了几个post,但无法弄清楚什么是错的。我的代码如下
#include <iostream> using namespace std; /* compiles with command line gcc xlibtest2.c -lX11 -lm -L/usr/X11R6/lib */ #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/Xos.h> #include <X11/Xatom.h> #include <stdio.h> #include <math.h> #include <stdlib.h> public class Point { int x; int y; public Point() { this.x=0; this.y=0; } }; /*Code For Xlib-Begin*/ display *display_ptr; Screen *screen_ptr; int screen_num; char *display_name = NulL; unsigned int display_wIDth,display_height; Window win; int border_wIDth; unsigned int win_wIDth,win_height; int win_x,win_y; XWMHints *wm_hints; XClassHint *class_hints; XSizeHints *size_hints; XTextProperty win_name,icon_name; char *win_name_string = "Example Window"; char *icon_name_string = "Icon for Example Window"; XEvent report; GC gc,gc_yellow,gc_red,gc_grey,gc_blue; unsigned long valuemask = 0; XGCValues gc_values,gc_yellow_values,gc_red_values,gc_grey_values,gc_blue_values;; colormap color_map; Xcolor tmp_color1,tmp_color2; /*Code For Xlib- End*/ int main(int argc,char **argv) { //////some code here }
谢谢…它的工作..对我是一个Java的家伙..一件事
如果我写的话会给出错误
private int x; private int y;
与linux中的内存映射设备进行通信
有一个libPNG 64位?
C#的windows服务configuration文件
如何判断一个文件在Python中是否可以在windows上执行?
.NETdevise视图不运行windows窗体OnLoad
如果在构造函数中使用Point(){this.x = 2; }
提前致谢
有一个windows IDE可以同时处理C和Perl吗?
如何从jvm.dll捕获堆栈跟踪?
在函数处理程序中直接使用写入函数的用户空间缓冲区(linux,Kernel)保存内存?
如何保持过程的记忆保护
任何方式来configurationcaching行为的代码?
将Java的语法改为:
class Point //access modifIErs cannot be applIEd to classes while defining them { int x; int y; public : //Note a colon here Point() :x(),y() //member initialization List { //`this` is not a reference in C++ } }; //Notice the semicolon
尝试这个:
class Point { int x; int y; public: Point(): x(0),y(0) { } };
您使用的语法看起来像Java。
总结以上是内存溢出为你收集整理的错误:预期“公共”之前的不合格id全部内容,希望文章能够帮你解决错误:预期“公共”之前的不合格id所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)