49,761 Topics
| |
I currently have the following code for a sprite struct (c-style for use in DLL): typedef struct LABglSpriteTAG { unsigned int glTexture; int w; int h; LABglColour *data; bool compiled; }*LABglSpriteHANDLE; And the following function: void LABglSpriteConvolute(LABglSpriteHANDLE spr, int w, int h, int *kernel) { size_t dim=spr->w*spr->h; LABglColour *out=new LABglColour[dim]; … | |
Hey All, I've got an assignment due tonight involving semaphores, and I can't seem to figure it out. I'm given the following program: #include "stdafx.h" using namespace System; using namespace System::Threading; ref class PrintTasks { public: static bool runFlag = true; public: void PrintDigit(Object^ name) { while (runFlag) { Console::WriteLine((String^)name); … | |
I am working on a struct program and it is working perfectly except for one thing. 2 of my struct elements are arrays and I can't populate them. I have tried a number of different things but I keep getting compiler errors. What is the correct way to pass an … | |
Hey everyone. I really need some help with my code for class. Here is the prompt : Write a program to manage a dictionary. The dictionary should be stored on a text file named diction.txt and consist of an alphabatized list of words, one per line. When a user enters … | |
so i fork n process: for(i=0; i<numOfProcess; i++) pid == fork(); if(pid == -1) //error handling if(pid == 0){ //child, do something exit(0); } else{ //parent //i want to wait till all children are done before continue..how? //i tried wait(NULL), and waitpid(pid, NULL, 0) //but both wont work..? //........... //something … | |
Hey guys. I'm new to this site. I just wanted someone to look over the code I have so far for a hash table that operates on linear probing. I don't have anyone to really check these things for me as my professor is always busy. Can anyone tell me … | |
i created some segement of shared memory using <sys/shm.h> <-- im not sure what this thing called.. shared memory? seems shared memory doesnt like dynamic allocation and vectors what are some apporaches i could create a 2D array like structure in shared memory? | |
hey all! i created a keylogger of my own in visual c++ 2010, and included iostream, windows.h winUser.h the problem m facing is that it runs only when visual c++ is open. as soon as i try to close it, it pops a message to stop debugging and if i … | |
Hi all, I encountered some weird act from the return(); function. I'm doing some book exercise in recursions: write a recursive function that makes a summation 1 + 1/2 + 1/3 + 1/4 + ... + 1/n. Rather basic. So I wrote this: float summation(int n) { if (n == … | |
Hi, I've been using C++ for quite a while but recently I discovered this peculiar behaviour. The following code works as expected: #define TWO 2; int nVal = 3 + TWO; cout<<nVal<<endl; // output is 5 ...if on the other hand I place the literal integer after the '+' in … | |
Me and my freinds are heading towards a C++ Game Project of Snake-Game in which a Snake is to be made of 6 "*"s and it is controlled with keybord.... We had progressed till here and weare finding difficulty in handaling more than 1 stars plz help #include<iostream.h> #include<conio.h> void … | |
Hello, I need to store the cooridants of a vector, for example: If the vector was: 0 1 0 1 0 0 1 0 1 0 0 1 1 1 1 0 0 0 0 0 And this vector is then split into blocks, I need to store the the … | |
I am wondering how to perform a 2D image blit with openGL. I used to use SDL and it was easy, but with opengl I end up making a rectangle with texture coords that is sunk a little into the screen. Is there any way to perform a 'real' blit? … | |
Pls i want to call a constructor within itself but don't know how to. | |
Hello again, I am asked by my professor to create a program using selection sort in a linked list. Selection sort with sorting only the data is pretty easy, but I'm having a hard time because he made us sort the nodes themselves. Can anyone help by giving atleast the … | |
The local pointer will be remove after i go out from that scope? or will remain? Example: int glb1 = 2; int main () { int var1 = 0; fnCall1(); fnCall2(); //at here } void fnCall1 () { int tmp1; tmp1 = 10000; } void fnCall2 () { int *ptr1; … | |
My name is Leon Norwood Jr....hmm.. Anyway I have this program that I'm nearly done with I have to do one of those ICAO(International Civil Aviation Organization program, in fact it's the same program that I did myself several weeks ago, I now have to do it again with arrays … | |
I am working on a practice exam right now and I came across a write-your-own code problem that I can't figure out. The question is: > Modify your first function. In addition to returning the greatest value by pass-by-value, you should also sent a true/false value back to main() if … | |
Hi, I have recently finished first game in C++ which has huge code which will be fixed in future who knows how many times. It is really not practical to publish entire .exe launcher as fix, but I heard that it isn't case with DLL files. I could simply create … | |
Hey guys, my first post so forgive me if I balls up posting this code. Anyway, this is my program for calculating the indefinite integral of any programmer-defined function given two limits of integration. Any thoughts or comments would be appreciated! #include <iostream> #include <cstdlib> #include <ctime> #include <cmath> using … | |
Straight to the point, I am using SOIL (http://www.lonesock.net/soil.html) library to upload images into OpenGl. Loading textures works fine but there is this thing i dont fully comprehend. Lets say I load an image into OpenGL via SOIL and I want to reuse the same image over few other textures … | |
how to find the roots of any given polynomial using newton raphson method if any one have the code plz share it | |
Could someone direct me to an open-source, 2D sidescrolling game developed in C++? (I'd prefer a Mario-style sidescroller, but almost any would do.) I'd like to look at the source code to see some examples of a working sidescroller collision detection system, and a jump algorithm. Thank you for your … | |
hi iam really interested in c++ game programming but i have have no idea how to get started and i have never used c++. i am using C and Java for about 2 years now. could any one let me know where can i learn graphic programming, game programming, where … | |
Hi. I'm making a shooting game and since my code was getting a bit messy and big I decided to divide it into couple of classes and files. I'm confused of how to correctly split these files and classes up though. As I imagine it without really knowing if that … | |
I am teaching myself C++ and amd now trying to simple programs related to data structures. I wrote this code for a simple stack. It is not working. I am frustrated and tired so I cannot think through the issue. There are two main problems with which I need help. … | |
Quick synopsis: Program sorts array the user inputs. IE enter 5,6,78,4,2 and it will sort it in order. Through various algorithms. This works great with quick small lists, but for some reason with one large number or longer lists the program will crash. Here are the files if you would … | |
This is a recursive selection sort i would like to be able to change this code without the use of loops into a bubble sort for my assignnment. Ive been trying for an extremelyy long time and im also fairly new to c++ and im struggling. any help would be … | |
| ok, so I have to do this problem to solve : Create a class Road that contains different stop points. A point is characterized by latitude, longitude, altitude. a. Validate the correctness of the values b. Create an array of Roads and display it c. Display the longest Road d. … |
I decided to learn C++ STL and I was exprimenting with STL containers. I saw this example [here](http://www.cplusplus.com/reference/stl/vector/insert/): // inserting into a vector #include <iostream> #include <vector> using namespace std; int main () { vector<int> myvector (3,100); vector<int>::iterator it; it = myvector.begin(); it = myvector.insert ( it , 200 ); … |
The End.