16 Discussion / Question Topics
Remove Filter Hello Daniweb, I'm currently working on a pretty straight-forward AJAX application. In this application, I get some XML, and then parse it. An example of what I'm working with is as such: [code] <?xml version="1.0"?> <postRoot xml:lang="EN"> <post type="comment" date="January 1, 1970"> <user>athlon32</user> <content>Hello World</content> </post> </postRoot> [/code] Now, I've … | |
I have a function in a Lua script, that will take a file and and will work on it. Part of the work it does is to empty the file completely before working with it. The easiest way I know of doing this is to open the file with [icode]io.open[/icode], … | |
Hello all, I recently was reading some code and i found something along the lines of this: [code="C++"]void GetText() { int* size = new int; // ....... // lots of code here // ....... size = new int; // crap here }[/code] ^^ as you can see size is 'new'ed … | |
Hello Daniweb! I'm coding a small application and I've hit a road block. I've been using C++ for almost two years now, but to be honest, I hardly use dynamic polymorphism (i prefer static), and so with great embarrassment, I come here to ask this: My code is basically structured … | |
I just learned about linked lists, so i decided to experiment a little. I'm trying to make a linked list that automatically keeps all of the data in consecutive order (like bubble sort built in :P). Anyways, the problem is that while it adds data, the second thing added disappears, … | |
I know a little DirectX 9(I can draw a little, etc.), but i want to learn DirectX 10. I decided to take the tutorial that is provided in the DirectX SDK, so i did. Almost immediately i noticed that it was heavy. My CPU usage shot up and it took … | |
I've been learning DirectX, and overall, I'm really happy, it's not to hard and i can do tons of stuff. Now that I'm on more advanced things like meshes, i've run into a couple questions that i needed answering. 1. What is a good free program for making meshes? (One … | |
I've decided to start my first real project in C++, so I picked something simple; to make a game just like Pong. I've got most of the GUI setup, but i have no idea where to start on programming the computer character that will play against the user. Does anyone … | |
Just few quick question: How often are pointers to functions used? Should i implement them in my programs? | |
I'm have a small confusion, and i need a little clarification; when you make something on the heap, like this: [code=C++]int *somePointer = NULL; somePointer = new int;[/code] an int is created on the heap right? This would be the equivalent of doing something like...: [code=C++]int x;[/code] ...directly on the … | |
I'm following a tutorial on Win32, and as I compile the examples, I'm also kinda messing with the code to experiment with different concepts. Here is a little ditty i worked with: main.cpp [code=C]#include <windows.h> #include <iostream> #include "prototypes.h" #include "defines.h" LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); void AddMenus(HWND); int … | |
When printing output to a terminal in C++, should i use "\n", or "endl"??? Is one lighter, faster, or industry standard? | |
This is my code that I'm using: [code=C]void create_project_go() { FILE *fp; FILE *fopen("/usr/lib/htmlexamples/default.html", "r"); };[/code] and i get this error: [code]/home/miguel/Documents/packing/create_project.c||In function ‘create_project_go’:| /home/miguel/Documents/packing/create_project.c|40|error: expected declaration specifiers or ‘...’ before string constant| /home/miguel/Documents/packing/create_project.c|40|error: expected declaration specifiers or ‘...’ before string constant| /home/miguel/Documents/packing/create_project.c|39|warning: unused variable ‘fp’| /home/miguel/Documents/packing/create_project.c||In function ‘get_project_info’:| /home/miguel/Documents/packing/create_project.c|46|warning: … | |
Hello All, I'm compiling my program, and i keep getting this error: [code]obj/Debug/fubar.o||In function `fubar::fubarl(int*, int*)':| /home/miguel/Documents/pointersandref/fubar.cpp|7|multiple definition of `fubar::fubarl(int*, int*)'| obj/Debug/fubar.o:/home/miguel/Documents/pointersandref/fubar.cpp|7|first defined here| ||=== Build finished: 2 errors, 0 warnings ===| [/code] This is my complete source code fubar.cpp [code=C] #include <string.h> #include <stdio.h> #include "fubar.h" void fubar::fubarl(int *foo, … | |
Ok...i've been getting a weird error in Gtk+. I've narrowed it down to this line: [code]gtk_menu_shell_append(GTK_MENU_SHELL(helpmenu5), about);[/code] that gives me this error: [code](packing:5236): Gtk-CRITICAL **: gtk_menu_shell_insert: assertion `GTK_IS_MENU_SHELL (menu_shell)' failed [/code] Now my program compiles, however the menu wont pop up and the terminal prints that error...does anyone know what … | |
I don't know if this is the right place to post this but here goes nothing. I know this is such a cliche from us C++ coders, but I wanna make my own open source OS. I would use something like BSD or Linux, but I really wanna use C++ … |
The End.