49,761 Topics
| |
Hey guys, I'm new to this whole programming deal and have browsed around these forums here or there to learn a few things. My latest assignment is to create a working tic tac toe game, including functions to initialize the game board, print the board, check the game status, checking … | |
Good afternoon Daniweb, I have a simple (and probably idiotic) problem today, I have a simplistic program that simulates a Train station, trains come in, they go into a stationDock and come out after a while. The stationDocks are an array of trains, either pointing to a train or being … | |
hello all; i'm having a problem with my output. the program that i'm writing is supposed to take a number input than display the output as asterisks. so if the input is 4 the output should be: * ** *** **** however, i'm just getting a single column of asterisks. … | |
Guys..Can anyone help me to explain what really happened in the while loop and both of the if else loop that makes this coding can find the root using bisection method.Thank you...[code]#include "stdafx.h" #include <iostream> #include <cmath> #include <iomanip> using namespace std; double f( double); int main ( int argc, … | |
I was wondering if there were away to repeat the same test multiple times and average the time. The code works fine [CODE] #include <cstdlib> #include <ctime> #include <iostream> using namespace std; void PrintArray(int* array, int n); void QuickSort(int* array, int start, int end); int partition(int* array, int pivot, int … | |
Hey guys, I came here to ask for some help on making a DoS(Denial of Service) program, Not MS-DOS :p. My problem is I don't know what i would use to make it function. I don't know and can't find the functions I would use to make it. I was … | |
If anyone could give me a pointer here I would be grateful. I am making a public function that takes to container objects called bags and a file name in their arguments. I'm trying to create a loop that would extract the first line of doubles in a file and … | |
What's the simplest way to write a Prime Factorization program in C++? (A program that lists all prime factors of a number) | |
I finished this last night and it almost works perfectly aside from one minor thing that I can't quite figure out. [CODE] #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int playerscore, computerscore; int turnscore; int dice; char input = 0; bool turnover, gameover; srand((unsigned)time(0)); playerscore … | |
Hello, I got a problem while making a new program. I am trying to make an interactive menu from which people can choose the type of the table they want. So the source (I won't release all of it just the part I got the problem) [CODE] box[20][75]={ "__________________________________________________________________________", "| … | |
Hi, If I were to write a program as follow: [CODE]if (x>90) cout<<"Excellent"<<endl; else if (x>80) cout<<"good"<<endl; else if (x>50) cout<<"average"<<endl; else cout<<"bad"<<endl;[/CODE] And i want to convert it to using switch case, how should i do it? I know how to use switch for constants like 1,2 and characters … | |
[code] // Windows Programming Tutorial Series #include "stdafx.h" #include <windows.h> int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MessageBox (NULL, "Hello World! This is my first WIN32 program", "Lesson 1", MB_OK); return 0; }[/code] 2 errors: Linking... LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/a.exe : … | |
Hi. I have some, probably, very basic questions. :D I'm making an engine, which will be script driven. But I'm concerned with the performance of plain text, even if it was loaded to the memory. I want the scripts to be executable very fast, since there would be a lot … | |
plz i want to know information about class libraries in C C++ Java .i want to know about History,how they work , etc | |
I've been struggling over this for hours, and just can't seem to figure out a formula for it. I'm trying to append below, (attach underneath) one matrix to the other. So for example, for Matrix A: 1 2 3 4 5 6 and Matrix B: 7 8 9 A.Append(B) becomes: … | |
tried to make this encryption program but it doesn't work, [B]I know[/B] I must have done something wrong, but I don't know how to correct it. A more effective solution to my "[I]if dWord is higher than 118[/I]" would be nice, thx for help:) [COLOR="Red"] here's the code![/COLOR] [CODE=c++] #include … | |
How could you input sound from the microphone on windows in real time? Something that would let you do something like this: [CODE] int main() { sound sample; while (1) { sample=getsound(); cout<<"Pitch: "<<sample.getpitch()<<" Volume: "<<sample.getvolume()<<"\n"; } }[/CODE] Would it be as simple as that, or am I going to … | |
I have coping with radix sort implementation for numbers which have different length, already I have problem about coding Radix sort for integers and now I need to consider different length numbers please help! Also the other problem is I need to get each number that are separated by blank … | |
So i called my Linked list destructor [CODE] ~LinkedList() { ListNode *current = head; ListNode *nextnode; while(current!=NULL){ nextnode=current->next; delete current; current=nextnode; }[/CODE] and i get.an error...._BLOCK_TYPE_IS_VALID(pHead->nBlockuse) for some reason it doesn't like the "delete current"...I could use some help...thanks. | |
Guyz Help Me on my College Project..,...PLz? Dear Friends... I am In Big Trouble.....Actually i had gotta project in which i have to write a program in C or C++ ,,in which program take ownership of a program say "c:\abc\xyz.exe" and then renames it to other than "xyz.exe" to whatever … | |
Hello All, I've been through this article and found it very helpful {http://msdn.microsoft.com/en-us/library/bb250489(VS.85).aspx}. I have a 'static' callback method in my BHO dll which is called whenever 'some' event on the computer happens. I need to call a javascript method on all open browser instances when that happens (or do … | |
i need some help on my pi approximation it's really slow. compile it and see for your self. i think my problem is with my math. it comes out with the wrong first few numbers. i'm trying to use gregory's formula or the advanced version of it.[CODE]#include <iostream> #include <conio.h> … | |
[code] //this game is played with a six sided die, on each player's turn he may roll until he gets a 1 from the die, at which point, all points accumulated to that point are wiped, he may hold and add the accumulation to his score at any time. #include<fstream> … | |
I've been able to open text files, read them and write to them. However, I always have to specify the name of the file before I compile. IE: ofstream myfile ("example.txt"); I've tried to declare a string, and then use that where the name of the file would nomally be, … | |
I need to write a function that adds entered values to a sequence AFTER the current_index [CODE]void sequence::attach(const value_type& entry) { assert(size( ) < CAPACITY); size_type j; if (!is_item()) current_index=0; for (j=used; j>current_index; --j) data[j] = data[j-1]; data[current_index] = entry; ++used; }[/CODE] current_index is the position in the dara array … | |
Here is the simplest program: [CODE]#include <iostream> using namespace std; int main() { cout << "hello" << endl; cin.get(); return 0; }[/CODE] When I ran it (using Dev C++), there is no output, just a blank screen. The problem seems to be from the "endl". If I delete it, or … | |
Everyone master ppl out ther. I have 2 doubts in my mind regarding C++. Let me tell u 1 thing before stating my problem, I m using Turbo C s/w as a compiler. 1. I m nt able to include <string.h> header file in my program. Whener I try to … | |
I am writing a simple program to take a user-supplied file, read the contents, and output email addresses found in the file. If the user supplied an invalid path/file name, I want to prompt the user to try again. Right now, everything works properly if the first file name the … | |
Okay friends this is actually my school work. My teacher asked me to make a diamond asteriks. I just try and with my code [CODE] #include<iostream> using namespace std; int main() { char b='*'; for(int i=10;i>0;i--) { for(int j=0;j<i;j++) { cout<<" "; } for(int c=10;c>i;c--) { cout<<b; } for(int a=10;a>i;a--) … |
The End.