51,593 Topics
![]() | |
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 … | |
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 … | |
[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 … | |
if you use movefile and ofstream the ofstream file won't be made.. :s any way to solve this? | |
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 … | |
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 … | |
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] … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
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") … | |
Friends can i return a list or a map from a function??? | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
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 … | |
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? ^^ | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 - … | |
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; … | |
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 … | |
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> … | |
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 | |
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) … | |
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 … | |
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 … | |
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 … | |
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 | |
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] … | |
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 … | |
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 … | |
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; … | |
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. … | |
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. | |
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 … |
The End.