49,761 Topics

Member Avatar for
Member Avatar for ravjot28

I made a project on telephone directory. I have used single class and my reading and writing in the file is done by fin.[write/read]((char*)&object,sizeof(object)); Now the problem is during searching a particular name or phone no. is just read the file and match the name or the phone no. in …

Member Avatar for Salem
0
82
Member Avatar for OffbeatPatriot

My project has gotten kind of big now but so I'm trying to post as little code as I can. It seems like the center of my problem is that I have a map for a game, at the start of this game the map is created and is constantly …

Member Avatar for ArkM
0
187
Member Avatar for qeinar

when i copy the file to the other directory i want the new file to be run instead of the file that i copyed there, i also want the first one deleated.. how can i do this? ^^

Member Avatar for qeinar
0
79
Member Avatar for 2fac323

I am posting this problem because I am a newbie to C++ and this program has me totally stumped. Any direction, advice, examples would be extremely helpful! I will try to explain my problem as well as possible- For research purposes and to better help students, the admission office of …

Member Avatar for Ancient Dragon
0
112
Member Avatar for joopdirksen

Hello, i'm relatively new to C++, and i'm wondering, how can i pass in an anonymous array into a method? [code] float color[4] = {1.0f, 1.0f, 1.0f, 1.0f}; showInfo("test", 10, 10, color, GLUT_BITMAP_HELVETICA_12); [/code] I want to put the float array color into the argument itself, so i don't have …

Member Avatar for Ancient Dragon
0
80
Member Avatar for JBtje

Hello, On a website I found the next source code "sniffer.cpp" [B]Sniffer.cpp[/B] [CODE=C++]/* OoOoOoOoOoOoOoOoOoO o HTTP-Sniffer o O www.1plus.se O oOoOoOoOoOoOoOoOoOo INFO: The trick is to use raw packets with SIO_RCVALL */ #include <iostream> #include <fstream> #include <string> #include <winsock2.h> #include <windows.h> #include <ws2tcpip.h> #include "packet_headers.h" using namespace std; #define …

0
88
Member Avatar for gangsta gama

Thank you Vernon, the money does decrease, but when I buy a pistol for $200 and go to stats it says I have $0 and 50 pistol ammo witch is correct. When I save it though It basicaly erases everything. I opened the file. It said this: 0 0 0 …

Member Avatar for gangsta gama
0
174
Member Avatar for edman

I need to create a function that uses a template to partially fill any array and from there search for a value in the array and return its position if found. The program below finds the values for double and int but I do know how to partially fill the …

Member Avatar for edman
0
268
Member Avatar for ninjaneer

I've been googling this topic for a while, but I haven't found a very clear tutorial. I have created a GUI in C# (it's so easy!) and now I want to implement a C++ backend that I've got that is already created (also the C++ backend uses Microsoft Foundation Classes …

0
70
Member Avatar for gispe

hi!! i just started programming some stuff in c++. i made a simple program that compares a number given by the user to 0 n say if its cero, positive or negative. [code=cplusplus] // num_positivo_negativo.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <math.h> #include …

Member Avatar for ArkM
0
565
Member Avatar for CoolGamer48

Hey, I'm running into some issues with delete[]. I have these lines: [CODE] delete[] temp1; delete[] temp2; [/CODE] in a loop. temp1 and temp2 are pointers to std::strings. In the first iteration of the loop, temp1 and temp2 are both NULL pointers. The statements work fine. In the second iteration, …

Member Avatar for CoolGamer48
0
1K
Member Avatar for acg05g

I need to make a Fibonacci Sequence and mating rabbits. I have the formulas but need help inputting. I have to get the chart to look like this ************************ Rabbit Population Growth ************************ Month Productive Pairs Unproductive Pairs Progeny Ratio ----- ---------------- ------------------ ------- ----- 1 1 0 1 - …

0
39
Member Avatar for OmniX

I have just started using C++ for the first time and I love it!!! First problem I have encoutered proably a simple one but [code] for (int a=0; a<10; a++) { for (int b=0; b<10; b++) { for (int c=0; c<10; c++) { if (b == 5) { break; beak; …

Member Avatar for Narue
0
169
Member Avatar for Ccrobinson001

I'm trying to read a text file into a do while loop. For some reason I can't get it to countinue until ants = 0 . there are two different simulations, once ants go to o the counter needs to reset and do another simulation. Can someone help me? the …

Member Avatar for VernonDozier
0
130
Member Avatar for brain

Hello, Would you please give a hint to define a template class specialization in a template class which is in a namespace I have tried following code with gcc 4.1 and get an error message but Visual studio has no problem with it. [code] namespace A { template <typename T> …

Member Avatar for vijayan121
0
133
Member Avatar for Nalini Srinivas

Hi, I am new to this MFC/Vc++, I am trying develop an application through which I want tranfer txt file to table in my DSn (.mdb) Columns in both the files are same. How do I make connection to txt file and my .mdb file.Please help me Thank you, Nalini

0
34
Member Avatar for Dameon

i have some problems that i need help with. would just putting: [CODE]quarter = .25 number % quarter dime = .1 afterQuarters = number - ( numQuarters*quarter ) afterQuarters % dime nickel = .05 afterQuarters = number - (numQuarters*quarter) afterQuarters % nickel penny = .01 afterQuarters = number - (numQuarters*quarer) …

Member Avatar for Dameon
0
110
Member Avatar for the_virus

Hello everyone! I have to build a project developed a few years ago with Visual C++ 1.52c, in Visual C++ 2008 but I have a lot of fatal errors(fatal error C1083: Cannot open include file: 'stdiostr.h': No such file or directory) for the old header files(stdiostr.h, graph.h, bios.h,strstrea.h). It's any …

Member Avatar for ivailosp
0
165
Member Avatar for redrum237

hi, i have been given a question asking to produce pseudo code for a game. here is the question: Zombie Island. 1. This is a simple turn based game. Set up a 2d grid. Onto the grid randomly position holes, zombies and a man (each represented by a simple character …

Member Avatar for ArkM
0
120
Member Avatar for sangham

Hi friends, Can you please help me with the syntax of how I will map a string to a function pointer using map stl? Thanks

Member Avatar for ArkM
0
7K
Member Avatar for herms14

guys..I would like to ask for some help. Im trying to read 10 integers in a text file and store it in a array. the problem is when I display it the numbers are treated one by one instead of putting them all together. For example when I display array[0] …

Member Avatar for CoolGamer48
0
119
Member Avatar for pepperc0n

Hi, I have a script to abstract a .txt files end with (*.dly). My problem is, I had to repeat the task by changing the file name manually. I need to abstract 100 files in a folder. Can somebody show me how to change my script so it can read …

Member Avatar for Ancient Dragon
0
146
Member Avatar for karang

Hi I was trying the code written in the following URL http://support.microsoft.com/kb/117565 to get the information about the page size But when I try to run the program I am getting the following errors: `CMyView' has not been declared `CSize' was not declared in this scope `CMyView' has not been …

Member Avatar for mitrmkar
0
94
Member Avatar for KaterynaK

I need to write a program that will read in a polish string and calculate the value of the string, using 2 linked list, a polish queue and evaluation stack. Here is what I got so far: [code=cplusplus] #include < iostream> using std:: cin; using std:: cout; using std:: endl; …

0
44
Member Avatar for naya22

I am writing the following program that calculates the average of a group of test scores where the lowest score in the group is dropped. It has the following functions: [LIST=1] [*]void getScore()-should ask the user for a test score, store it in a reference parameter variable, and validate it. …

Member Avatar for Manutebecker
0
3K
Member Avatar for tusharvichare

Hello, I am developing an application using MSVC 6.0 in that application I want to show image in form background. if anyone have idea about this then please tell me. Thank You.

0
63
Member Avatar for henpecked1

I'm trying to create a contributor class with one enumerated type. I took the member functions from the header and put them in a cpp, but I get an error for the enumerated type when I try to compile. Is it because I haven't written a code body for that …

Member Avatar for henpecked1
0
103
Member Avatar for Gromnie

This is the first program that i've written myself, i've been using one of those learn C++ in 21 days books and links from daniweb to learn. Using daniweb is a whole lot less boring than reading that crappy book. I'm just looking for a review, some advice, anything about …

Member Avatar for Ancient Dragon
1
131
Member Avatar for scarypajamas

I have a class called Thing that defines vector<string> stuff. I have no problem declaring anything I want inside "class Thing" itself or functions from it, like "void Thing::bob" works fine. My problem is when I inherit this class. For some reason I get my program terminated. pseudocode: [CODE]Class Thing …

Member Avatar for Narue
0
139
Member Avatar for TehBlue

[code] int shutdown() { int time; int hmm; string name2file; string name; string nametofile; string name2; ofstream file; ofstream file2; cout << "\nHow long do you want to wait till shutdown?(in seconds)\n"; cin >> time; cout << "What would you like to name the batch file?\n"; getline(cin,name); name2file = name …

Member Avatar for Dave Sinkula
0
113

The End.