51,593 Topics

Member Avatar for
Member Avatar for 11silversurfer1

Hi, I was wondering with the menu bar how to open, save and make a new file on the menu bar [code] case MENU_FILE_ID_OPEN: { //something to open the file } break; [/code] i have no idea at all how to do this, i have searched the net but it …

Member Avatar for 11silversurfer1
0
157
Member Avatar for lingol

I'm writing a function that reads an IP address from input and generates its 32-byte values. If the input is correct, the whole thing can be done by this: [CODE=C++] int a, b, c, d; char buf; cin>>a>>buf>>b>>buf>>c>>buf>>d; ... [/CODE] If it's not, such as 256.0.0.0, or 1..2.3.4, I want …

Member Avatar for lingol
0
197
Member Avatar for GFXtm

[B]Array.h CLASS[/B] [code=c++] #ifndef __ARRAY_H #define __ARRAY_H template <typename DataType, int size, DataType zero> class Array { public: // set function, sets an index void Set(DataType p_item, int p_index) { m_array[p_index] = p_item; } // get function, gets the index DataType Get(int p_index) { return m_array[p_index]; } // clear function …

Member Avatar for vijayan121
0
447
Member Avatar for qeinar

if you use movefile and ofstream the ofstream file won't be made.. :s any way to solve this?

Member Avatar for qeinar
0
139
Member Avatar for nayrb

Hello, I tried posting this earlier but i do not think it went through because my internet connection was cut off. In case it did i am sorry for the repeating it, but have not seen it on the site. Any ways. I am writing a class program and i …

Member Avatar for AceofSpades19
0
138
Member Avatar for sftwr21

Hello everyone, I'm learning programming for the first time and my first book i bought from the book store is the new Deitel C++ 6th edition. After reading the first several chapters I got so overwhelm with the authors verbose; I went out and bought C++Primer. One thing I noticed …

Member Avatar for Alex Edwards
0
398
Member Avatar for klactose

Hi, I am trying to write a class that uses vectors that contain another class. When I compile my code using g++ I get the following error that I don't understand: [B]In file included from cars.cpp:5: car.h:24: error: syntax error before `;' token car.h:25: error: syntax error before `;' token[/B] …

Member Avatar for Ancient Dragon
0
87
Member Avatar for justinclev

well in a program i m making i need a loading screen it wont be doing anything its just a prank thing im doing but i need like it to sit and look as if its loading for half a minute can anyone help im in the dos box still …

Member Avatar for 11silversurfer1
0
135
Member Avatar for vadan

Hi, Iam very much new to programming and C++ please help me I have an application that uses socket++ classes on Unix (AIX) environment I have included #include<sockinet.h> in two of my .cpp files and I have socket++ source in my temp directory when iam trying to compile my application …

Member Avatar for Ancient Dragon
0
80
Member Avatar for Wiki_Tiki

Hi everyone, I've written a test program, and I need help limiting the amount of characters a user enters in a char. I want it so that that maximum amount of characters is 1, and if they enter more than 1, it will display a message. Here's my code: [CODE]#include …

Member Avatar for Ancient Dragon
0
129
Member Avatar for DS_sniper

Hay everyone, first time poster. I am designing a program in Visual C++ 2008 Express Edition and i need the following code It is a console app. I need code to beable to create a directory on drive C. I also need some info about how to copy the programs …

Member Avatar for DS_sniper
0
93
Member Avatar for bleh1318

Hi, Being someone who is now working with C++ but initially started with Java, I am experiencing some problems seperating my classes from the main file. So I want to seperate the following simple class into it's own standalone C++ file so I can use it with multiple programs: #include …

Member Avatar for ArkM
0
110
Member Avatar for himsymcpp

hi friends, I want to calculate the amount of heap memory at runtime at any point in the program. how do I do this?? do we have a function for it. Thanks, himanshu k. symbian application developer

Member Avatar for ArkM
0
2K
Member Avatar for ambarisha.kn

The following is giving output as follows String:Astro.cfg Fail If buff is Astro.cfg, it has to give success output, but it is giving fail. I want to print Success.. Please guide me regarding this pointer usage.. [code] #include<iostream> using namespace std; int main() { char arr[]="Asto.cfg"; char *buff=&arr[0]; printf("String:%s",buff); if(buff=="Asto.cfg") …

Member Avatar for CoolGamer48
0
86
Member Avatar for sangham
Member Avatar for bwspoon

I'm using CInternetSession and CFTPConnection MFC classes to put a file to an FTP server. However there is an intermittent problem showing up where the file appears on the remote server as incomplete, missing the last couple of hunder bytes. The CFTPConnection.PutFile() returns success, indicating that nothing went wrong even …

Member Avatar for mitrmkar
0
95
Member Avatar for simeon.andreev

The problem I need to solve is: create a multitude of Stacks with different types of data. And what makes it difficult for me is the following: In the multitude there should be all sorts of data stacks. Would it be stacks with integers, chars, objects from user defined classes …

Member Avatar for simeon.andreev
0
121
Member Avatar for OmniX

I am trying to get quite a large number 0.00012354684 to X required decimal places. Using <iomanip> and setprecision() but I cant seem to get it to work. Could someone please give me a small example. Thankyou, Regards X

Member Avatar for Nick Evan
0
116
Member Avatar for KoXaR

Hi, Please help me with this one as it's driving me crazy for some days now. I want to send some data to to web form in this page [url]http://www.belestrane.nadlanu.com/site/default.asp?lang=en[/url] probably through a HTTP POST method and then read the response and use that in my c# windows application. With …

0
50
Member Avatar for KenTheFurry

Well I am going to try and make an anonymous emailer using C++... I would like to use this to learn how to send commands to a command prompt or something like it because the normal way to do it through the the command prompt then telnet or netcat into …

Member Avatar for Nick Evan
0
56
Member Avatar for OmniX

I have 8.5 million combinations which are then put through 30 if statements. Then final output. Now I havent tried this yet BUT I dont think php will let me make a 8.5 million length array nor will C++. So what else can I do? Are there any other lanuages …

Member Avatar for Nick Evan
0
154
Member Avatar for FTProtocol

Is it possible to get the local time of a machine ( i can do this part ) then generate a random number between 1-5 ( i can do this ) then add the two together then execute a file when that time comes. Like: Local Time: 10:05 Random Number: …

Member Avatar for Salem
0
84
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
85
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
189
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
80
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
114
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
82
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
100
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
175
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
270
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
71
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
610
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
173
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
134
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
136
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
114
Member Avatar for ninjaneer

I'm writing a GUI for a C++ program I have already written. Currently I need to either port a section of C++ code using MFC to the C# program, or use a wrapper and call the functions from C#. I'd like to be able to create cWinThreads to do some …

Member Avatar for ninjaneer
0
208
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
168
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
122
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
123
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
148
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
98
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
45
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
65
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
108

The End.