49,757 Topics

Member Avatar for
Member Avatar for bookmark

[CODE]// #include <iostream> using namespace std; #include <cmath> #include <math.h> int main() { float a, b, c, t, s, area; cout << "Enter the lengths of your triangle's sides: "; cin >> a >> b >> c; if(a>b) {t=a; a=b; b=t;}; if(b>c) {t=b; b=c; c=t;}; if(a>b) {t=a; a=b; b=t;}; if((c*c) …

Member Avatar for bookmark
0
216
Member Avatar for madankumar

Hi This is Singleton class program, please let me know any changes required in this code............... #include <iostream> using namespace std; class Singleton { private: static bool instanceFlag; static Singleton *single; Singleton() { //private constructor } public: static Singleton* getInstance(); void method(); ~Singleton() { instanceFlag = false; } }; bool …

Member Avatar for MyNameIsLJ
0
195
Member Avatar for karishma10

hello, i am a beginner to visual studio. i want to know how can i use pthread in visual studio 2008. am i supposed to download the dll? if yes, then after downloading how can i use that dll in my project. please help. Karishma.

Member Avatar for ekailan
0
951
Member Avatar for keekee769

I need help...This is the class i am supposed to use... [CODE]#ifndef_MINESWEEPER_H #define_MINESWEEPER_H #include <iostream> #include <ctime> #include <cstdlib> using namespace std; const int SIZE = 3; class minesweeper { public: minesweeper(); minesweeper(int mines); void resetGame(); int flagCell(int x, int y); void unflagCell(int x, int y); int uncoverCell(int x, int …

Member Avatar for keekee769
0
102
Member Avatar for shafik_s

Hi everybody I defined an array pointer to hold a massive amount of data, (actually the RGB data of a screen with 1024*768 pixels). the data is assigned from another temporary array to the this array within a function that calculates the values of the temporary array and then assign …

Member Avatar for shafik_s
0
203
Member Avatar for jogieglenmait

I have a problem with my console program. I have a text file named "myRecord.txt" with the following contents: 101,Carlito Caballero,500.00 102,Tina Gamboa,560.34 103,Angel Caballero,750.55 104,Kyla Shane,850.32 105,Jogie Glen Mait,1000.00 If I run the program, the console should prompt the user to enter the id number (which is the set …

Member Avatar for jogieglenmait
0
372
Member Avatar for warzone

[I]<<edit: [URL="http://www.daniweb.com/forums/post191005.html#post191005"]split from here[/URL]>>[/I] Hi. My i ask something?,,can you help me please to solve this Problem? How Can i call Full Record using strtok and strcmp in text file Please!!!! [CODE]101, Carlito Caballero, 500.00 102, tina gamboa, 560.34 103, angel caballero,750.55 104, kyla shane, 850.32[/CODE] Here's the code [CODE]#include …

Member Avatar for jogieglenmait
0
480
Member Avatar for rebellion346

I'm working on a prototype program for my class assignment. I didn't wanna jump into it quite yet until I understood how functions worked so I decided to make this. It's going pretty well and now what I'm trying to do is make it so the program takes user input …

Member Avatar for rebellion346
0
112
Member Avatar for kakaliki

I am mostly familiar with C++. :?: Please help. Question is below : Write a program to discover how many numbers between 1 and 40 can be expressed as the sum of 4 positive squares (e.g. 15 = 12 + 12 + 22 + 32).

Member Avatar for kakaliki
0
264
Member Avatar for aman rathi

hello everybody hi im a student of SGRRITS (my institute) in my inst we have turbo c++. is it a good platform for doing programming now a days and does any industry us it now a days. no.2: please can you suggest me its substitute which are better than it. …

Member Avatar for aman rathi
0
110
Member Avatar for Peter4n31

Hello. I am debugging a larger project and a tool called Crash Validator keeps pointing line 1 in my code extract:"inline bool SortKnownFiles2 (etc.)" in DirLoader.cpp Error message in Crash Validator is “Cannot create a file when that file already exists.” (in c++ it runs fine, except a few random …

0
75
Member Avatar for Suzie999

Is it possible to password protect a dll at compiletime. Please excuse my noobness, but let me explain what I mean. You app an runtine makes a lot of calls to a function in a library so it opens it and keeps it open for the duration your app is …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for ziggystarman

Hello I'm looking to extract jpeg image data from a mjpeg stream, but I'm not sure how to do this in c++ . The code snippet below does the job of connecting to the remote ip camera server & receives the mjpeg stream via tempBuffer variable. [CODE] // Loop and …

Member Avatar for ziggystarman
0
2K
Member Avatar for suncica2222

can I use fopen,and fwrite with ShellExecute? to take file in buffer,drop it in directory and run it with ShellExecute I did this way but I just get cmd window and file is corupted do I have to use some API to take file in buffer?

Member Avatar for suncica2222
0
164
Member Avatar for peterman.k

I just started my mid level c++ class. In the past we have been using Visual Studio, which I can access thru a VM that our school supplies, so I can program from my Mac no problem. In this class, however, we are switching to a linux based programming tool, …

Member Avatar for jamillion
0
378
Member Avatar for burcin erek

[CODE]#include <iostream> #include <conio.h> using namespace std; main() { int a,b; b=50; cout<<"enter a value less than 50: "; cin>>a; do { cout<<"A number: "<<a<<endl; a++; Sleep(100); } while (a<=b); getch(); return 0; } [/CODE]

Member Avatar for Stefano Mtangoo
0
105
Member Avatar for saransh60

I did'nt understand here in this code i was reading a book and then const char *q="Hello"; //string is fixed pointer is not *q='M'// error q="bye"; //works char * const t="Hello"; //string is fixed pointer is not *t='M'// works t="bye"; //error so my question is in first if string is …

Member Avatar for nbaztec
0
97
Member Avatar for lukename

Hello guys. How can i get my file path? I konw my program's name but i don't know where it will be put. How can i get file path during program's execution? Thank you

Member Avatar for William Hemsworth
0
162
Member Avatar for kchyn

Hey guys, I have a question. I'm writing a script in c++ and want to have the script copy a file whose name was previously determined by the script to a output file who's name is determined through functions and procedures within the script. The whole script is looped until …

Member Avatar for nbaztec
0
194
Member Avatar for Luckychap
Member Avatar for burcin erek
0
1K
Member Avatar for sgw

Something that puzzles me in the following simple program: [CODE] #include <iostream> using namespace std; int main() { int row; cout << "enter row: "; cin >> row; int K[row], m[row][5]; cout << "Enter all the " << row << " K values:\n"; for (int i=0;i<row;i++) cin >> K[i]; cin.ignore(10,'\n'); …

Member Avatar for burcin erek
0
177
Member Avatar for stereomatching

i am curious about the unordered map of boost this is the first code I wrote [code = first] typedef pair<int, int> axis; typedef boost::unordered_map<axis, int> mCost; void testUnorderedMap() { mCost mc; axis p(0, 0); mc.insert(mCost::value_type(p, 3)); p.first = 0; p.second = 6; mc.insert(mCost::value_type(p, 33)); p.first = 0; p.second = …

0
45
Member Avatar for stereomatching

I need to store about 0.1million int into the unordered_map and need the key(int, int) to search them The size of the data are fixed, and I don't need to change the data so oftenly Search is much more often than insert(more than 20 times of insert) I try to …

0
39
Member Avatar for Bri426

I'm writing a program that asks the user how many numbers they would like to input, then proceeds to ask the user to enter the said amount of numbers. At the end, the program computes the sum, average, largest number and smallest number. I've got the entire program figured out, …

Member Avatar for gju
0
1K
Member Avatar for PierreK

Hello all, Im working on my assignment that deals w/ the use of classes but I'm a bit stuck at the moment. The assignment overview is fairly simple: I just need to read in a .dat file which contains some elevation data into a 2d array and then use that …

0
49
Member Avatar for ccube921

Line 34 and 35 won't execute unless I insert them into the for loop. [CODE]#include <iostream> using namespace std; int main() { cout<<"Please enter an integer.\n"; int intege; int integ; for ( int inte = 1; inte = 1; ) { cin>> intege; cin.ignore(); cout<<"Please enter it again."; cin>> integ; …

Member Avatar for ccube921
0
278
Member Avatar for ccube921

When I press enter after the execution of the code, it doesn't terminate and tell me the process time etc. it just skips a line. [CODE]#include <iostream> using namespace std; int main() { cout<<"Please enter an integer.\n"; int intege; int integ; for ( int inte = 1; inte = 1; …

Member Avatar for ccube921
0
206
Member Avatar for blaxarbush911

I have created a program that is based off the guess the number. But what ive added is a menu with four options 1 - 1 player 2 - 2 player 3 - high scores 4 - end game. Now I have the two combined at which im sure it …

Member Avatar for blaxarbush911
0
132
Member Avatar for Dark Byte

I am using VC++ 2010 and I am trying to use SFML 1.6. I am trying to create a simple window. I am using Release mode because debug never works I get the error shown here [url]http://img529.imageshack.us/img529/8281/captureers.png[/url] Release works, but when I close the window it gives me these errors: …

Member Avatar for Ancient Dragon
0
176
Member Avatar for glenak

For all you experienced C++ developers, do you mostly develop windows applications? What's your IDE of chioce, the one you feel is best suited for such development? Would that be Visual Studio 2008 (or 2010, since that is the latest) or something else - like Eclipse or Netbeans?

Member Avatar for Valaraukar
0
141

The End.