49,761 Topics
| |
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 … | |
Hi, I’ve 3 classes : A, B and C. The class A includes an object from the class B and another object from the class C. In my class B, I’ve a function that returns a vector of struct. This function is called in the class A and after that … | |
Hi, I have the following code which compiles absolutely fine.. [CODE] using namespace std; #include<iostream> #include<stdio.h> #include<conio.h> struct node { int data; struct node *link; }; void add(struct node **,int); void display(struct node*); int count(struct node *); int main(void) { struct node *p; p=NULL; add(&p,5); add(&p,1); add(&p,6); add(&p,4); add(&p,7); display(p); … | |
I have seen in a couple of places that strstream objects are deprecated, but there are also stringstream objects. My compiler has 2 headers <strstream> and <sstream> and I don't know which is which. In light of this, which header should I use to produce more modern code? I suspect … | |
[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> int main() { ifstream indata; // indata is like cin char num; int sar,ri,sat,ha; sar=0;ri=0;sat=0;ha=0; char s[]=".txt"; for(int some_int=1;some_int<=3;some_int++){ ostringstream buffer; buffer <<some_int; string s1 =buffer.str(); s1+=s; indata.open(s1.c_str()); … | |
Hello! I've been learning how to code C++, but entirely Console apps! Can you tell me how I can convert Console apps into GUI apps? [Only using libraries built into Dev-C++ {yes, I know it's a pain!}] Thanks in advance, Panarchy |
The End.