49,761 Topics
| |
[CODE]// This is a program that displays the choice the user picks using a Switch Statement #include <iostream> #include <string> using namespace std; int main() { // Underneath A switch program that shows the user his input choice string word1 = "Achieve"; cout << "Welcome to Your AccuWeather Report Screen." … | |
I have to calculate the modal value of [icode]std::vector< int >[/icode] quite often, so I thought I'd share my general method for people to look at, use and/or comment. In my case, the vectors usually contain values in the range 0 - 255. The code first creates a [icode]std::vector< int … | |
Hi there, I am new to using Visual C++ 2005 enterprise Edition. I do not know how run a C++ program in it. It's environment is similar to Turbo C++ 5.5 IDE but still I can't see any 'Run' command anywhere and Ctrl+F9 does not do anything !!!!! Please help … | |
hey,thats my first post,i started recently to have for hobby programming,and i am really interesting to learn. anyway i have a problem i write a program that use some classes objects my problem is probably fundamental but i couldnt find answer on net. i have one header file that i … | |
Hey guys, I have a problem with a chess game I'm creating using Windows Forms. The purpose of this code is that I have a load of panels with picture boxes inside them. When the user moves their cursor over the panel or the picture box, the panel lights up … | |
I'm writing a program for a class that does operations with rational numbers. I'm not finished with it, but right now i'm working on the is_negative() function which is required to be in the program by the teacher. He has set up a make file to test each part of … | |
[CODE] #include "windows.h" #include "loadbmp.h" // from http://gpwiki.org/index.php/LoadBMPCpp #include "fdlib.h" void main(int argc, char *argv[]) { int i, n, x[256], y[256], size[256], w, h, threshold; BMPImg *bi; unsigned char *bgrdata, *graydata; if (argc==1) { printf("usage: fdtest bmpfilename [threshold]n"); exit(0); } bi = new BMPImg(); printf("nloading %sn", argv[1]); bi->Load(argv[1]); w = … | |
Hey... Not very experienced with computers here and I seem to have done something very wrong. I found a C++ beginner book and decided to give it a go. It came with Visual C++ 2005 express edition. I went online, found out there is a 2010 version and installed that … | |
You have a computer with only 2Mb of main memory. How do you use it to sort a large file of 500 Mb that is on that disk? This was a question that I was asked.... but I couldn't figure out the answer. Please help !!!! | |
Hi all, I know you guys get a lot of questions regarding hangman game programs and I'm sorry to bog down the boards with another question regarding the game. I've combed through previous posts trying to see if my issue has been resolved and I have been unsuccessful. Here is … | |
Hello, I am currently working on a school assignment, and I have spent a great amount of time on this, but I am coming up with a couple of error messages that I can't figure out. Here is my code: [CODE]#include <iostream> #include <string> using namespace std; class Date { … | |
Hello I have some trouble interpreting a string and I hope you can help me. I have to convert a string, or a word in a number. Like five hundred fifty in 550. I dont know exactly how to do it. I was thinking to try to analize each word, … | |
My project is to optimize wind turbine placement in a given area. In order to do this, I'm using both a wind simulation program (openWind: awsopenwind.org) and the a genetic algorithm code base (Evolving Objects: eodev.sourceforge.net). The process should work like this: openWind will randomly place wind turbines in its … | |
The code below is the code I used last semster to turn decimal format intergers into hex, now is there a way I can reverse this function, and have it turn hex into dec. Also the reason it is in a function format is we were studying funtions at the … | |
Hey there!I'm doing this symbolic differentiation program,and i have some problem with the code.The code in the "main" is ok ,but i have problems in the "to_term" function.Can you help me out to find where my mistake is?Please if you have any idea reply me now Thanks. [CODE]#include <iostream> #include … | |
Hi there, I have done a small exercise (ex 4.17 on C++ how to program - deitel and deitel) which basically is about writing a program that uses a while statement to determine and print the largest number of 10 numbers input by the user. The program should use 3 … | |
Hey everyone, I'm trying to do something like this: [code=c++]typedef void * socktag int gensock_connect (char * hostname, char * service, socktag * pst) { int retval; connection * conn = new connection; if ((retval = conn->get_connected (hostname, service))) { gensock_close(0); *pst = 0; return (0); } *pst = conn; … | |
Okey , this is what happends , when I write in my code and compile it this error shows up. [URL="http://data.fuskbugg.se/dipdip/Problem%20med%20c%2B%2B%20script.jpg"]http://data.fuskbugg.se/dipdip/Problem%20med%20c%2B%2B%20script.jpg[/URL] And after recieving this error I can't run it ofcourse... , I got the code from a book " Learn c++ in 3 weeks" I copied the code and … | |
i have written the code and tried to compile, but it always say that the file can't be read, yet i have put the same name file in one directory with the c++ file. need your help so can read the file on my mac.. #include <iostream> #include <fstream> #include … | |
Hai everyone Can u please help me in writing a basic singleton programme in C++ and please explain code that are specially used to make the class singleton else please send a link where I can get the same Thanq Have a nice day | |
plz can any1 chk my program for errors[CODE]public class MinHeap{ private int size=100; private int list[]=new int[size]; private int currentSize=0; public boolean isFull(){ if(currentSize==size) return true; return false; } public boolean isEmpty(){ if(currentSize==0) return true; return false; } public void insert(int val){ int current,parent,temp; if(isFull()) System.out.println("Heap is full"); else{ list[++currentSize]=val; … | |
Hi there. I was trying out a relatively simple program to convert a line of text into a 2-D string array which each word in a different row but it isn't working. The program is [CODE] #include <iostream> void main() { int i, j, k=0; char line[30]={"This is a test"}, … | |
Here I have a small piece of code: [CODE]ofstream hello ("hello.txt"); hello << "Γειά σου!"; //hello in greek hello.close();[/CODE] And here is the output: [CODE]Output on greek windows: "Γειά σου!"[/CODE] [CODE]Output on english windows: "ÃåéÜ óïõ!"[/CODE] Can someone, please, help me find out how to fix this? | |
Anyone with dbx experience know how I can watch a variable? | |
What happens if I have a method declaration of: [code=c++]int method( char * a, char * b, int * c );[/code] and then I pass in: [code=c++] char a; char b; int c; method(a, b, &c); [/code] This has me a little puzzled. What values will be passed by reference? | |
plz help me in my algorithm to first enter data in array then making a min heap out of it [CODE]#include <iostream> #include <stdlib> using namespace std; class Heap { int currentsize; int *array; int capacity; void heapsort(int[],int); public: void buildheap(); void isempty(); void isfull(); int getsize(); } main() { … | |
Hello programmers :), I'm creating a program that requires too many command line parameters to run. I noticed that many system programs in Ubuntu (my operating system) have the feature of auto-completion of the command line parameters. So, for example, if you type the following in Ubuntu: sudo apt-get i<tab> … | |
how to use the FXPrintDialog class i create an object and for that constructor i passed one FXdialogbox object which i need print is it correct please help me any one thanks in advance [CODE] #include <fx.h> // Main Window PrintTestDialog class PrintTestDialog : public FXDialogBox { // Macro for … | |
Hello all: I would be grateful for some basic advice about C++ error handling. From my reading, I understand that the "try, throw, catch" method is preferable to dealing with return values, which can be cryptic. But I'm not sure if I understand exactly how this works. I made a … | |
Hi All, I am a new member of this forum. i have some query related to USB device. Actually , i want to copy a file/ folder by sector or file level from One source volume to destination volume. Main requirement is this that: a) Source Volume to Destination Volume … |
The End.