49,766 Topics

Member Avatar for
Member Avatar for yup790

I have noticed that there isn't a thread where you are given puzzles. So i going to change that! Your puzzle is to make an exacutable c++ program that outputs "hello world" 20 times (try to be exciting). Rules: it has to be c++ it has to work I look …

Member Avatar for mrnutty
0
220
Member Avatar for indr

hi , i saw the following link [url]http://www.cplusplus.com/reference/iostream/manipulators/setprecision/[/url] and tried it in the same way... #include<iostream> #include<iomanip> using namespace std; int main() { float a=3.14; cout<<fixed<<setprecision(4)<<a; } so my output should be:3.1400. but when i execute the above code.. i am getting the error as fixed undeclared..

Member Avatar for Ancient Dragon
0
184
Member Avatar for vbx_wx
Member Avatar for mrkaran

i have a code to check lexeme is keyword or not: [CODE]void Is_Keyword_Or_Not() { char *keywords[]={"INCLUDE","VOID","MAIN","i","var","cin","cout","if", "then","else","and","or","not","loop","exit","when", "while","until"}; int j=0; flag=0; for (j=0;j<18;j++) //search for keyword & # of keywords = 18. { if (strcmpi(lexeme,keywords[j])==0) { temp.assign(lexeme,INCLUDE); flag=1; break; } } } [/CODE] i have defined macros like: INCLUDE 1 …

Member Avatar for mrkaran
0
86
Member Avatar for clement99

Hi guys, i'm trying to extract the data "Lady Gaga Fame Monster" from the html below using substr and find, but i wasn't able to retrieve the data. [code=html]<div class="album-name"><strong>Album</strong> > Lady Gaga Fame Monster</div>[/code] I'm tried to extract the whole string first, but i can only extract till <strong>Album</strong> …

Member Avatar for clement99
0
721
Member Avatar for indr

hi i am trying to use setw with a string.. here is my code.. [CODE]string a="hello"; cout<<setw(10)<<a;[/CODE] i inserted string header and iomanip header files... now my output should be with a few number of blank spaces and then it should print hello.. but its not working for me... could …

Member Avatar for indr
0
443
Member Avatar for sangoku

Hy i Know it is not on English but could somone take a look on my code and tell me what I am doing wrong.... [CODE] #include <iostream> #include <fstream> //ukljucujemo cstring biblioteku koja omogucava napredne operacije sa stringovima #include <cstring> using namespace std; #define VELICINA 40 //fixsno definisemo vlisicinu …

Member Avatar for sangoku
0
391
Member Avatar for frogboy77

Hey there. Just beginning to learn c++ on my own(not easy). Please fogive my lack of knowledge. I have a list of large numbers(50 digits) that i copied. I want to split them into an integer array of size [100][50]. I dont want to have to go through and put …

Member Avatar for frogboy77
0
127
Member Avatar for jwebb

Hello, I'm trying to create a program to calculate the factorial of variable int input. I am using xcode, and it's giving me an error saying "factorial was not declared in this scope" on the line within the else statement. I have found other programs on the internet, but I …

Member Avatar for jwebb
0
676
Member Avatar for sfuo

Hey guys I have come up with a solution for the problem I have but I would like to know how I could do this the way I initially had it set up but without the leak of course. vec3f.h [CODE]class vec3f { public: GLfloat _x, _y, _z; vec3f(){}; vec3f( …

Member Avatar for mike_2000_17
0
156
Member Avatar for prince26121991

[CODE]Memory of a variable or object automatically terminated of finish at the end of program than why we use destructor?[/CODE]

Member Avatar for Lusiphur
0
3K
Member Avatar for Rez11

When reading out of a textbook, is it good practice to write your code while looking at examples in the book? Is there any tips or advice someone can give when it comes to learning C++ from a book?

Member Avatar for denguru4
0
116
Member Avatar for cgcgames

I give up hehe. been looking over the form and the internet and couldnt find anything that worked. what i want to do is simple. i have made a program that uses a MDI form (basicly a shell form that opens forms in it). and in the menu bar it …

Member Avatar for cgcgames
0
80
Member Avatar for daviddoria

I posted a while back about how to overload << It seems all the examples online have the second argument as const, ie [code] ostream & operator << (ostream &output, const Point &p); [/code] but if I have a member function that simply returns a double [code] double Point::getX() { …

Member Avatar for daviddoria
0
193
Member Avatar for sana_moi

hellow; im working on visual studio c++ express ediion 2010 when i chose a win32 project i can include any dll as wont and it's work without a problem but when i chose clr application windows form and i include for exempl sql.h i had this error pleas help me …

Member Avatar for safe2010
0
243
Member Avatar for Silvershaft

Hey, this might be a stupid question, but I just looked into the code of one thing which I can't tell what it is, but you get the idea here: [code] static ChatCommand unbanCommandTable[] = { { "ip", 'm', &ChatHandler::HandleIPUnBanCommand, "Deletes an address from the IP ban table: <address>", NULL, …

Member Avatar for mike_2000_17
0
96
Member Avatar for camcam08

im using dev c++ my problem is how to create a notepad when i run the program.. ex. i input a name.. and then it will create a notepad in my document and the name of the .txt file is the name what i input. thx in advance.

Member Avatar for helpme87
0
200
Member Avatar for mitchneys

hello help me...i need to create a parse tree with this source code: #include <iostream.h> int main() { int x,y; double ave; cout<<"Enter first number"; cin>>x; cout<<"Enter second number"; cin>>y; ave=(x+y)/2; cout<<"The average is"<<ave; return 0; }

0
64
Member Avatar for plizz

I think that I misunderstood something about class definitions in c++... Why it is legal to define class in multiple files, like this: file Test.cpp: [CODE]#include <iostream> using namespace std; void testFunc(); class A { public: void printText(); } clA; void A::printText() { cout << "file: Test.cpp, class: A, method: …

Member Avatar for mike_2000_17
0
276
Member Avatar for hanvyj

I am trying to make a dll but I am coming up with the following error: \Debug\VideoCapture2.dll.intermediate.manifest : general error c1010070: Failed to load and parse the manifest. The system cannot find the file specified. I set up my project according to [URL="http://msdn.microsoft.com/en-us/library/ms235636(VS.80).aspx"]msdn[/URL] using visual studio 2008. I looked for …

Member Avatar for hanvyj
0
599
Member Avatar for gutiarfanatic7

I'm trying to write a blackjack game, but I ran into a problem with random integers. I'm to the point where the player has there original number, and they've chosen to hit. I need help figuring out how to make random_integer keep it's value, but then add another random integer …

Member Avatar for sfuo
0
150
Member Avatar for Ultratermi

Hey, is there a way to recognize the click on the "Show Desktop" button? Can be in C#, too. Thanks :D

Member Avatar for daviddoria
0
69
Member Avatar for lilfish08

I am fairly new to c++ and have been working on this problem and asked the professor for help, but he has really been non-compliant. I am lost on this and keep gettin error messages that I do not understand how to fix. Any help that could be given would …

Member Avatar for lilfish08
0
208
Member Avatar for lilfish08

Hi I am having trouble with this program, because if the user inputs a multiple word answer for the second question, it will only display the first word of the given answer. And I tried using getline(cin, answer) instead, but that just did not even ask me for an answer …

Member Avatar for lilfish08
0
170
Member Avatar for imthiyas92

PLS HELP ME TO CODE THE MAGNETIC FIELD AT A POINT FROM A CIRCULAR CURRENT LOOP BY BIOT-SAVART LAW.PLS HELP NEED TO SUBMIT COMPUTER PROJECT WILL DUE TOMMORROW PLSSSSS HERE IS CODE BY MY OWN WAY #include <iostream> #include <conio.h> #include <stdlib.h> #define M 4*3.14*10^-7 main() { float B,N,I,R; cout<<"Enter …

Member Avatar for mike_2000_17
-1
873
Member Avatar for PixelExchange

Hello everyone. I have seen in quite a few programs, a menu that is actually scrollable. Not a scroll-bar (that can be implemented on a window via the WS_HSCROLL|ES_AUTOHSCROLL flags) but a scroller menu. The menu I am reffering to is often seen inside of windows folders, where the menu …

Member Avatar for PixelExchange
0
103
Member Avatar for saransh60

[code] #include <iostream> using namespace std; using std::cerr; using std::cout; using std::endl; #include <sstream> #include <string> #include <fstream> using std::ifstream; #include <cstdlib> // for exit function // This program reads values from the file '1.txt' // and echoes them to the display until a negative value // is read. int …

Member Avatar for Ancient Dragon
0
168
Member Avatar for Petitcharatonyo

Hello World! I'm new in the forum and I don't have too much experience with C++, I'm looking for help with my code, I hope you could help me :) I have to read from a file.txt different collumns, each of them corresponds to a parameter and store them in …

Member Avatar for sfuo
0
580
Member Avatar for rombo

I'm doing a Win32 video application and I've started with the SimplePlay sample of last Windows SDK v7.0. When I want to release the video and display a picture through an WM_KEYDOWN event the last video frame remains until an WM_SIZE or an WM_MOVE event is received. Namely, I have …

0
37
Member Avatar for xavier666

Here is a very simple code demonstrating how 'protected' is used [CODE]# include <iostream> using namespace std; class A { protected : int a; }; class B : public A { public : void f_1() // * { a = 10; cout << a; } }; int main() { B …

Member Avatar for Fbody
0
115

The End.