49,761 Topics

Member Avatar for
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
440
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
354
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
125
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
673
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
155
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
115
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
189
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
240
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
94
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
188
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
271
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
592
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
148
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
207
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
168
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
858
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
102
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
167
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
575
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
113
Member Avatar for miskeen

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 …

Member Avatar for harris21
0
10K
Member Avatar for gaurav_13191

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); …

Member Avatar for arkoenig
0
101
Member Avatar for Fbody

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 …

Member Avatar for Fbody
-1
159
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> 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()); …

Member Avatar for saransh60
0
198
Member Avatar for Panarchy

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

Member Avatar for Ancient Dragon
0
100

The End.