49,761 Topics

Member Avatar for
Member Avatar for smcp

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 …

Member Avatar for Salem
0
120
Member Avatar for jonyb222

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 …

Member Avatar for jonyb222
0
3K
Member Avatar for digiguy

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. …

Member Avatar for digiguy
0
89
Member Avatar for callister

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, …

Member Avatar for StuXYZ
1
126
Member Avatar for rwill357

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 …

Member Avatar for niknailer
0
122
Member Avatar for KronicZ

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 …

-3
92
Member Avatar for correaj

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 …

Member Avatar for correaj
0
865
Member Avatar for hey joe
Member Avatar for JTX

What's the simplest way to write a Prime Factorization program in C++? (A program that lists all prime factors of a number)

Member Avatar for NathanOliver
-1
73
Member Avatar for logicmonster

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 …

Member Avatar for logicmonster
0
113
Member Avatar for D4n1sD

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]={ "__________________________________________________________________________", "| …

Member Avatar for abhimanipal
0
87
Member Avatar for wilsonz91

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 …

Member Avatar for abhimanipal
0
145
Member Avatar for linq

[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 : …

Member Avatar for NathanOliver
2
194
Member Avatar for Excizted

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 …

Member Avatar for Dave Sinkula
0
120
Member Avatar for niro_fernando

plz i want to know information about class libraries in C C++ Java .i want to know about History,how they work , etc

Member Avatar for niro_fernando
0
95
Member Avatar for sexyzebra19

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: …

Member Avatar for sexyzebra19
0
92
Member Avatar for kangarooblood

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 …

Member Avatar for jonsca
0
164
Member Avatar for EvanEjk

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 …

Member Avatar for tomtetlaw
0
216
Member Avatar for erogol

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 …

Member Avatar for Salem
0
112
Member Avatar for karolik

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.

Member Avatar for Salem
0
114
Member Avatar for naveenjoshi

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 …

Member Avatar for Salem
-2
78
Member Avatar for n_vcplus

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 …

0
109
Member Avatar for ppl154

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> …

Member Avatar for Salem
0
133
Member Avatar for kotkata

[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> …

Member Avatar for WaltP
0
273
Member Avatar for foco

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, …

Member Avatar for WaltP
0
102
Member Avatar for BlinkOnly

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 …

Member Avatar for WaltP
0
160
Member Avatar for sgw

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 …

Member Avatar for ppl154
0
139
Member Avatar for akshay25088

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 …

Member Avatar for kvprajapati
0
138
Member Avatar for bogenbroom

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 …

Member Avatar for bogenbroom
0
1K
Member Avatar for ne0_komodo

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--) …

Member Avatar for ne0_komodo
0
192

The End.