49,761 Topics

Member Avatar for
Member Avatar for harirock
Member Avatar for lxXTaCoXxl

These are just some of the more useful #define statements I've used in C++. These are some of the statements you'll use the most (in the case of template<typename T> when you use it, you use it a lot!). So I figured I'd post it for others, even though a …

Member Avatar for sepp2k
-4
266
Member Avatar for rithish

i need c++ e-book that should have programs from hello world,addition to vectors,map.in all books they cover only the concepts and finish by 3 programs in a topic.i need a c++ book that covers more than 500 to 800 programs please suggest me a good book.

Member Avatar for moutanna
0
77
Member Avatar for Tinnin

I'm trying to print out whether a number is prime or not up to and including the user inputted integer. The problem I'm having is that regardless of the user inputted integer, the loop only runs up to 4. How do I break from the nested loop without ending the …

Member Avatar for deceptikon
0
156
Member Avatar for glao

Hello , i am trying to understand how periodic boundary condition works.Of course, i understand what it is and how it works,just i am trying to implement it in c++ and i have some problems.( for now i want to make it work in 1d but i want it for …

Member Avatar for glao
0
3K
Member Avatar for MasterHacker110

By C++ game engines i mean the language that the game is programed in is C++. I know irrlicht but it aint good for very big games becuase you have to code where everything is. At the moment i am using Unity but the language looks like C#. So what …

Member Avatar for mihbd1207
0
481
Member Avatar for triumphost

I just started shared memory and I took a big dive into it and got stuck trying to figure out how to share pointers. Well not really pointers: void* pData = MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, MapSize); Ok so the above holds my view of the file to be shared between …

0
92
Member Avatar for triumphost

Hey all. I'm having a problem with a DLL being loaded. In codeblocks, if I don't export Main + ALL the functions in my DLL, they cannot be used by an external program! Yet in visual studio, I exported nothing and external programs are able to load the DLL. Example: …

Member Avatar for triumphost
0
521
Member Avatar for aabbccbryanmark

print "enter a number: "; $in = <>; chomp $in; print &prime($in); print "\n"; sub prime{ for($i=2;$i<($_[0]/2+1);$i++){ if($_[0]%$i ==0){return "not prime\n"} } return "prime\n"; } is this code for c++ language?..

Member Avatar for WaltP
0
299
Member Avatar for brad.ward.33

In this assignment, I am having to insert user information to tables that we have created and I am having this error that keeps on telling me " Code No: 80040e14 Code Message: IDispatch error #3092 Error Source: Microsoft OLE DB Provider for SQL Server Error Description: The name 'Br' …

Member Avatar for brad.ward.33
0
371
Member Avatar for Labdabeta

I have two bounding boxes defined by the following values: m1.min.x;//the min x value of model 1 m1.min.y;// " " y " " " " m1.min.z;// " " z " " " " m1.max.x;// " max x " " " " m1.max.y;// " " y " " " " m1.max.z;// …

Member Avatar for Labdabeta
0
663
Member Avatar for triumphost

How can I iterate a buffer with a stride? For example, I saved the pointer to a vertex buffer for later use. I've got the stride, the pointer, and triangle count for vertices. I want to iterate my pointer using this info to get the vertices. I'm doing it wrong …

Member Avatar for triumphost
0
309
Member Avatar for Pyler

#include <iostream> #include <string> using namespace std; double distance(double x[],double y[]){ return sqrt((y[0]-x[0])*(y[0]-x[0])+(y[1]-x[1])*(y[1]-x[1])); } int main(){ double d; double x[]={1,2}; double y[]={4,3}; cout<<distance(x[2],y[2])<<endl; //cout<<d<<endl; cin.get(); return 0;} why wont it work I also tried d=distance(x[],y[]); cout<<d<<endl; but it wont work either

Member Avatar for NathanOliver
0
82
Member Avatar for letterG

Hi again, I ran to some problems in input some codes but i'm quite sure that my code is correct but the output is not what I expect it to be, this is my code: #include<iostream> #include<string> #include<sstream> using namespace std; struct movie{ string title; int year; }; struct info{ …

Member Avatar for letterG
0
159
Member Avatar for newbie1234
Member Avatar for L7Sqr
0
335
Member Avatar for phorce

Hello, I'm trying to write the Cooley Turkey algorithm for an FFT. Now, The algorithm works well, but, only for 2 numbers - Nothing else. For example, I have used an online FFT calculated, entered the same data and got the same results. Here is the code for the algorithm: …

0
125
Member Avatar for coolikedat99

I was trying to create a program that would require the correct password to be put in in order for it to display something. I was able to make a program that would require the right password to display a certain thing. But the problem is that it can only …

Member Avatar for coolikedat99
0
164
Member Avatar for triumphost

What are the last 4 values for? (m[0], m[4], m[8], m[12]) (m[1], m[5], m[9], m[13]) (m[2], m[6], m[10], m[14]) (m[3], m[7], m[11], m[15]) I've looked everywhere and cannot figure out what m[3], m[7], m[11], m[16] are for (ModelView Matrix).. It says to ignore them but I can't just ignore them …

Member Avatar for mike_2000_17
0
157
Member Avatar for JamesWorth

Hi! I'm new in this forum. I was reading some other posts about Directx and so. Now I have a problem with Lightning in Directx. I wanted to do some graphics like minecraft's ones, with cubes. And when I got my cube class ready, i drawed one cube and that …

Member Avatar for DeeperShade
0
225
Member Avatar for idislikemacs

I'm done with my tic-tac-toe program, but now I want to ask a simple question to the winner of the match to make the victory absolute. Would I need a while loop? I also feel my code is too messy, how can I enhance/improve it? Thank you! #include <iostream> using …

Member Avatar for Ancient Dragon
0
309
Member Avatar for dancks

I originally asked this question at cplusplus.com but got no responses. In my program I have the main player and enemy tanks. When using the shotgun weapon it works fine for the main player but it kills the bad guy when they use the weapon. I don't understand how this …

0
142
Member Avatar for az_ez

Hi, I have to make a GUI to input data into an SQL server 2008 r2 database, and I was hoping someone could give me a heads up about the how to do it? I remember the basics of doing it in Access but of course its different with each …

0
76
Member Avatar for kelechi96

Basically I have created a sprite sheet/tileset with dimentions of 320 x 2048, the tiles are each 32 x 32. I've been able to load individual files with textures in them but I don't seem to be able to load textures from a sprite sheet. Any help ? Here is …

0
106
Member Avatar for phorce

Hello, I'm wondering if anyone knows if there is a specific way or a library that allows me to read in an audio file in which I can then manipulate and get the different frequencies? I'm basically trying to make an application that uses an FFT for the audio signals …

Member Avatar for Banfa
0
297
Member Avatar for sachintha81

In my C++ Win32 program I want to set the current Display Settings to "Extend" mode. I Googled and found out that SetDisplayConfig() is the way to go forward in Windows 7 (I'm on Windows 7) but now I am kind of stuck how to proceed as the MSDN explanation …

Member Avatar for sriv
0
2K
Member Avatar for RonKevin

okay so im kind of confused now. . . . . i didn't even have a code to show you cause I know its wrong..I've been absent 2 days on my Programming so its really hard to cope up...i tried researching for ifstream.h and ofstream.h....and so far ifstream.h is for …

Member Avatar for RonKevin
0
566
Member Avatar for khallebal

hi all all the deps were met,and autotools & ./configure run smooth,but make fails with the following error,tried with gcc2 & gcc4 environement,the same error, i hope to find some help here. here it is: In file included from xine.c:33:0: /boot/develop/headers/bsd/string.h:16:7: error: expected declaration specifiers or '...' before '(' token …

Member Avatar for rubberman
0
174
Member Avatar for mochiboo5

hello everyone, I am having a major problem with this assignment that asks to create a function whose input is a reference to an input file, which asks user to enter a file name to open for input, then checks to see where the file opened successfully. the function returns …

Member Avatar for Karkalash
0
274
Member Avatar for mochiboo5

Hi everyone, this is my first post and I am new to C++. I am trying to figure out how to do this project. Newton’s method is an algorithm that can be used to solve an equation of the form f(x) = 0 using a sequence of approximations. Here’s how …

Member Avatar for DavidB
0
3K
Member Avatar for macla

Hi, I have 2 GB file with 10 million lines. Is anyway to sort the file content without loading the full file content into memory

Member Avatar for WaltP
0
452

The End.