49,761 Topics

Member Avatar for
Member Avatar for Phil++

Hey, what I am trying to do is change the way people open text files in c++. What I want to do is: open("example.txt"); which will then open the text file "example.txt" and have a header file that displays like: [code] string line; ifstream file ("example.txt"); if (file.is_open()) { while …

Member Avatar for Phil++
0
142
Member Avatar for headedtomexico

So I've got this piece of software that is written in C++. I also have a website hosted on hostgator with linux server i believe. I have a MySQL database with usernames and passwords. What I want to happen is for my client application that is written in C++ to …

Member Avatar for headedtomexico
0
495
Member Avatar for guest7

Hi, I have a file output.txt as follows : c FILE c c c p val 25 36 8 1 0 -1 -8 0 -9 -7 0 -9 -2 0 7 2 9 0 -10 6 0 -10 8 0 -6 -8 10 0 -11 -9 0 -11 -3 0 …

Member Avatar for Comatose
0
523
Member Avatar for c++noobie

I am trying to overload operator++ for a type I have defined. Here' s a little explanation beforehand. I am working on a link_list class that can be used to create dynamic arrays of any type. I created a basic_link template to hold each element of the array. Each basic_link …

Member Avatar for c++noobie
0
332
Member Avatar for guest7

Hi, I wish to generate all the binary combinations for an input size n. So, the number of combinations in this case would be (2^n) and if n=2 my output should be : 00 01 10 11 How can i do it? What would be the best way? Thanks

Member Avatar for MosaicFuneral
0
423
Member Avatar for winrawr

Are there any reeeally good books on programming C++ that anyone knows of? Ones that just do an excellent job of teaching different techniques and clean coding practices, as well as things that can really be applied (like making and styling windows, communicating via TCP/IP, etc)?

Member Avatar for winrawr
0
112
Member Avatar for #include<James>

[CODE] #include <iostream> #include <cstdlib> #include <cstdio> #include <ctime> using namespace std; int main() { srand(time(0)); int number; number = 2; while(2 == number) { int random; random = rand() % 2; string alpha[3]; alpha[0] = "a"; alpha[1] = "b"; alpha[2] = "c"; string list[3]; int ran; ran = rand() …

Member Avatar for Murtan
0
129
Member Avatar for serhannn

Hello, I'm working on a code for my project at college. The goal of the project is to find and extract keywords, and the sentences, which contain these keywords from many text files, which I have already downloaded from Internet using another code. These text files are actually source codes …

Member Avatar for serhannn
0
256
Member Avatar for winry

Hi everyone!I've started to learn C++ couple of months ago and having some trouble with the code i'm trying the write.. I have to write a function that converts every digit of the parameter to zero,except 2.And number of digits is unknown.. I made this but its's output is always …

Member Avatar for winry
0
280
Member Avatar for CoolGamer48

I have a child of std::exception defined as: [CODE=c++] struct image_load_failed : public std::exception { image_load_failed(std::string const s) : message(s) {} virtual ~image_load_failed() throw() {} const char* what() const throw() { return "image load failed";//message.c_str(); } std::string const message; }; [/CODE] (I would normally have what() return message.c_str(), but I've …

Member Avatar for CoolGamer48
0
497
Member Avatar for minas1

Well my main() function has become a mess... What should I do next time to prevent this? [code="C++"] int main(int argc, char *args[]) { srand((unsigned)time(0)); if(!init()) return 1; atexit(cleanup); // to cleanup the surfaces // load images background = loadImage("background.jpg"); message = loadImage("play_again.jpg"); youWinMessage = loadImage("you_win.jpg"); youLoseMessage = loadImage("you_lose.jpg"); start: …

Member Avatar for Comatose
0
207
Member Avatar for atish00

I have posted the update member function as many the 12th students can copy my project. I want to open the binary file compare the roll numbers with the inputted roll if it matches the object of the file should be overwritten with a new object i.e *X. [code] void …

Member Avatar for atish00
0
119
Member Avatar for tomtetlaw

I want to make an overlay to act as a HUD (Heads-Up-display) for my game in DarkGDK with objects (representing what gun i am carrying) and sprites (representing things like health and ammo) and i dont know how, can someone tell me? any help would be appreciated, thanks in advance! …

0
37
Member Avatar for tomtetlaw

For this bit of code: [code=c++] if ( dbCameraPositionX ( 1 ) == dbObjectPositionX ( 3 ) && dbCameraPositionY ( 1 ) == dbObjectPositionY ( 3 ) && dbCameraPositionZ ( 1 ) == dbObjectPositionZ ( 3 ) )// the 3 is the ID number for the object, which DarkGDK requires. …

Member Avatar for Salem
0
88
Member Avatar for Phil++

What I am trying to do is change the cin >> varible; into something different so when I find it easier when I code. The line that I am changing it to is input (varible); i am using this: #define input(i) cin >> (i); it works, however it will only …

Member Avatar for minas1
0
117
Member Avatar for tomtetlaw

Why wont my gun show up? [code=c++] #include "DarkGDK.h" void DarkGDK ( void ) { dbSyncOn ( ); dbSyncRate ( 60 ); SetCurrentDirectory ( "resources" ); dbLoadObject ( "skybox2.x", 1 ); dbSetObjectLight ( 1, 0 ); dbSetObjectTexture ( 1, 3, 2 ); dbScaleObject ( 1, 5000, 5000, 5000 ); dbLoadObject …

Member Avatar for tomtetlaw
0
90
Member Avatar for Gekitatsu

Long story short I am trying to pull 2 types of data from a file. A string (which I have now got working) and a int. While these are easy on their own what I am trying to do is not so. I am trying to search through a file …

Member Avatar for Yiuca
0
174
Member Avatar for tomtetlaw

In DarkGDK how do you place objects? I know about and how to use the dbLoadObject ( ); function but i dont know how to place it where i want to, like XYZ co-ordinates. also when i run this: [code=c++] #include "DarkGDK.h" void DarkGDK ( void ) { dbSyncOn ( …

0
58
Member Avatar for learning_prog

Hello, please help me. I am using microsoft visual C++ 2008 express edition. I am following Sams teach yourself C++ in ten minutes and am stuck on "hello world" This is my source code file: #include <iostream.h> int main() { cout << "Hello World!\n"; return 0; } I clicked "Build …

Member Avatar for John A
0
125
Member Avatar for hpatch

well...im compiling rBot.exe when suddenly these errors below just appeared..does anyone knows any solutions or fixes???...thank you for your help... --------------------Configuration: rBot - Win32 Debug-------------------- Compiling... dcass.cpp C:\Documents and Settings\Visitor\Desktop\rx-asn-2-re-worked_v3\rx-asn-2-re-worked v3\includes.h(18) : fatal error C1083: Cannot open include file: 'windns.h': No such file or directory dcom.cpp C:\Documents and Settings\Visitor\Desktop\rx-asn-2-re-worked_v3\rx-asn-2-re-worked v3\includes.h(18) …

Member Avatar for Ancient Dragon
0
340
Member Avatar for mini programmer

Hi; If I do in classes; class class1; class class2; and I make in (class class1) Composite Objects from class class2;. [code=cplusplus] class class1 { private: class2 ** PointerClass2; public: PointerClass2 = new class2*[size]; // so I need to put deconstructor to delete (the pointer dynamic memory location) ~ class1 …

Member Avatar for mini programmer
0
190
Member Avatar for findlay

Hello All, I am experiencing a problem with the STL map class (or rather the map class is experiencing a problem with me). I am trying to store a number of 2-dimensional vectors of type int, whose corresponding keys are strings. The problem arises when I try to index a …

Member Avatar for findlay
0
128
Member Avatar for massivefermion
Member Avatar for skatamatic
0
75
Member Avatar for iaaan

Hey, I am trying to replicate a sort of Windows Media Player type library and was wondering if there was such a thing (or an equivalent) as an Multi-Column Listbox. Currently, I have the data coming in but storing them into 3 different listboxes (Artist, Title, Album). This works at …

Member Avatar for skatamatic
0
606
Member Avatar for kashyapanirudh

Hi. I'm a final year B.E student. Just wanted some topics that can be done as a final year project.. Want to knw some applications that i can build so that i can look out for something.

Member Avatar for skatamatic
0
92
Member Avatar for monere

Hello, I need to read mp4 video files, perform basic (simple file cut) on-line editing functions and write edited files to disk. Question: Is there a means to programmatically access the video file playing time file information without having to play the file on media video player such as Quick …

Member Avatar for skatamatic
0
99
Member Avatar for Phil++

Hey, I'm trying to upload a file to a FTP server using c++. The code works fine but it just will not connect / upload the file. I am using tripod, could this be the issue? Does anyone know any FTP sites that will allow me to upload please? Thank …

Member Avatar for Murtan
0
269
Member Avatar for komofilms

Hello guys! Im new in C++ programing, and I want to get and put same data in my COM. I dont have problems with basic data types. My IDL: [propget, id(FW_DISPID_OFFSET), helpstring("property Offset")] HRESULT Offset([out, retval] short *pVal); [propput, id(FW_DISPID_OFFSET), helpstring("property Offset")] HRESULT Offset([in] short newVal); My Cpp: STDMETHODIMP CYslider::get_Offset(short …

Member Avatar for Ancient Dragon
0
94
Member Avatar for heimdhal

I've got an array of pointers to my class "Rule" Now I'm trying to access it from within a member function AddRule. But on the first line I keep getting "Memory Access Violation" Can anyone tell what's wrong? [code] class RuleSet { private: public: Rule *Rules[200]; int RuleNum; void AddRule(Rule); …

Member Avatar for heimdhal
0
100
Member Avatar for am_valentin

Hello, I am having a diploma project about building a LAN Monitor, in wich I need to capture the traffic from network card at low level layer. More like Data-Link layer. Can anyone help me with a suggestion of a function or a method to substract bit packets directly via …

Member Avatar for am_valentin
0
65

The End.