48,986 Topics

Member Avatar for
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
144
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
119
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
92
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
143
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
215
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
113
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
270
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
101
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
159
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
137
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
182
Member Avatar for CollinRyans

[CODE]#include <iostream> using namespace std; int main() { int intArrayList[] = {4, 6, 2, 10, 9}; cout << "Unsorted list : "; for(int i = 0; i < sizeof(intArrayList)/sizeof(int); i++) { cout << intArrayList[i] << " "; } [COLOR="red"]intArrayList[/COLOR] = InsertionSort(intArrayList); for(int i = 0; i < sizeof(intArrayList)/sizeof(int); i++) { …

Member Avatar for mrnutty
0
82
Member Avatar for TheWolverine

Hi all, I've spent the last week trying to sort this out, and the more I delve into it, the more confused I'm getting. I've done some background research (searched on google and here for sort function issues) and really I can't make head or tail of what's going on. …

Member Avatar for dusktreader
0
4K
Member Avatar for ELBUF

Hey guys, Im making an uno card game and I think so far so good, however once I compile it, my program doesnt read any errors, but a box pops up stating "vector subscript out of range" and it is confusing me a lot. I think I can identify where …

Member Avatar for ELBUF
0
2K
Member Avatar for CppBuilder2006

why does this program have an exception in VC++ 2008 Express? [CODE] #include <conio.h> //#include <C:\WString(v2.00).h> #include <iostream> #include <string> using namespace std; class WCS { public: wchar_t* string; WCS(const wstring& wstr) { wchar_t* c = new wchar_t [wstr.size() + 1]; wcscpy(c,wstr.c_str()); string = c; } ~WCS() { delete [] …

Member Avatar for CppBuilder2006
0
205
Member Avatar for sexyzebra19

My program keeps crashing and I can't see why...pretty sure its something to do with creating matrix B since when I remove the commands to create matrix B it runs ok. Can anyone see what is wrong? Thanks in advance! I have the header file: [code=php] // matrixlib.h - A …

Member Avatar for sexyzebra19
0
320
Member Avatar for Vitriolics

Hi, I used to have difficulty with more advanced bits of scope but eventually understood but after a long break from c++ i have of course forgotten bits. my problem is with this bit of code: [CODE]std::vector<int>::iterator it[/CODE] as i understand it this bit of code creates an iterator for …

Member Avatar for Narue
0
117
Member Avatar for sgw

I just saw someone's program that assigned string this way: [CODE]string x("snow");[/CODE] It seems to work, as I could display the output x as "snow". Is this a legible way to assign strings? How does it differ from [CODE]string x="snow";[/CODE] ?

Member Avatar for Fbody
0
182
Member Avatar for turrence27

In a question i am required to add every other number starting from the right most side and going left on every other number. I have a code that is almost right as i am led to beleive. the code is: [CODE]#include <iostream> #include <cmath> int main () { int …

Member Avatar for turrence27
0
2K
Member Avatar for abhimanipal

Hello People, I just came across this code as I was browsing through some C++ problem sets. This code gives compile time error but I am unable to understand the reason. I am C guy and my knowledge about C++ is not that great. So pardon if there is an …

Member Avatar for sheff_cc
0
125

The End.