49,766 Topics
![]() | |
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 … | |
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.. | |
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 … | |
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> … | |
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 … | |
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 … | |
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 … | |
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 … | |
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( … | |
[CODE]Memory of a variable or object automatically terminated of finish at the end of program than why we use destructor?[/CODE] | |
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? | |
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 … | |
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() { … | |
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 … | |
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, … | |
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. | |
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; } | |
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: … | |
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 … | |
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 … | |
Hey, is there a way to recognize the click on the "Show Desktop" button? Can be in C#, too. Thanks :D | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … |
The End.