49,761 Topics

Member Avatar for
Member Avatar for Labdabeta

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]; …

Member Avatar for mike_2000_17
0
1K
Member Avatar for Mindless Z

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); …

0
68
Member Avatar for adohertyd

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 …

Member Avatar for histrungalot
0
275
Member Avatar for amberrrrrNJ

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 …

Member Avatar for amberrrrrNJ
0
201
Member Avatar for wildplace

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 …

Member Avatar for histrungalot
0
10K
Member Avatar for MastrLuigi

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 …

Member Avatar for MastrLuigi
0
265
Member Avatar for wildplace

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?

Member Avatar for wildplace
0
169
Member Avatar for f4fjks

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 …

Member Avatar for f4fjks
0
946
Member Avatar for FelineHazard

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 == …

Member Avatar for FelineHazard
0
190
Member Avatar for deanus

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 …

Member Avatar for deanus
0
105
Member Avatar for geekdevil

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 …

Member Avatar for Labdabeta
0
318
Member Avatar for phorce

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 …

Member Avatar for Labdabeta
0
138
Member Avatar for Labdabeta

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? …

Member Avatar for Labdabeta
0
521
Member Avatar for capton
Member Avatar for capton
0
2K
Member Avatar for cryonize

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 …

Member Avatar for mike_2000_17
0
10K
Member Avatar for murnesty

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; …

Member Avatar for rubberman
0
130
Member Avatar for nekoleon64

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 …

Member Avatar for ChrisPadgham
0
643
Member Avatar for pattmorter

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 …

Member Avatar for pattmorter
0
213
Member Avatar for MrEARTHSHAcKER

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 …

Member Avatar for Ancient Dragon
0
167
Member Avatar for Bennigan88

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 …

0
52
Member Avatar for nuclear

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 …

Member Avatar for nuclear
0
2K
Member Avatar for tornado2232

how to find the roots of any given polynomial using newton raphson method if any one have the code plz share it

Member Avatar for ravenous
0
184
Member Avatar for Chuckleluck

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 …

Member Avatar for Serapth
0
205
Member Avatar for hwoarang69

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 …

Member Avatar for Serapth
0
185
Member Avatar for enkitosh

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 …

Member Avatar for Serapth
0
361
Member Avatar for Nathaniel10

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. …

Member Avatar for Nathaniel10
0
118
Member Avatar for rmbrown09

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 …

Member Avatar for rmbrown09
0
145
Member Avatar for kmg2012

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 …

Member Avatar for TrustyTony
0
240
Member Avatar for terrah

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. …

Member Avatar for Ancient Dragon
0
142
Member Avatar for sergent

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 ); …

Member Avatar for sergent
0
406

The End.