49,761 Topics

Member Avatar for
Member Avatar for igodspeed

Hello, I am try to compile this code using gcc in ubuntu. I get the error 'btree.cc:(.text+0x55a): undefined reference to `std::cout' '. I thought if i added using namespace std; it would start working but i am still getting the same error. Any suggestion on how i can fix it. …

Member Avatar for igodspeed
0
238
Member Avatar for XinJiki

Hello, I need some help with my homework assignment fir my C++ class, here is a description of the assignment: Write a program that reads this file and finds the longest word that contains only a single vowel (a,e,i,o,u). Output this word (there will actually be several ties for the …

Member Avatar for XinJiki
0
242
Member Avatar for oxy77

I am trying to write a summation to aprox. pi. I am using a for loop and I cannot figure out where I am messing it up. I keep getting "program has exited with code 0" [CODE]for(int N = 0; N <= 15; N++) {double x9 = 0.0; for(int n …

Member Avatar for oxy77
0
96
Member Avatar for futura

Please excuse me if this has already been covered before. I'm a C++ beginner, and in of the problems I have to do, the input has to be like this: 1) A number n is entered. 2) n number of strings are entered. I tried using a 2D character array …

Member Avatar for futura
0
84
Member Avatar for StaticX

Hi all, im wondering if someone could offer a solution to my current problem which is passing and return information using pointer notation. I have created a small program using the class Person, who has a first and last name and methods to add and retrieve this information which looks …

Member Avatar for Jiwe
0
98
Member Avatar for Jeff_5_7

ok i have a 2d array and i want to trace through it. The Array is RDL DLU i have an entry point of Row1 Col1 which i think is letter R. On this array R means shift right L is shift left U shift up and D shift Down. …

Member Avatar for Jeff_5_7
0
509
Member Avatar for blakenbama

I'm taking my first class in c++ this semester, so i'm a newb. The only other programming experience i have is in python. My teacher gave me this assignment and i don't even know where to start. I don't want anyone to post any code, but a few tips on …

Member Avatar for WaltP
0
1K
Member Avatar for Marson

Hey guys, I am trying to write a program that will use command line arguments to detect user inputed keywords in a text file and output how many times the keyword/s appear. The command line should read like this... programname -f inputfile keyword1 keyword2...keywordN The problem I have is I …

Member Avatar for WaltP
0
182
Member Avatar for sexyzebra19

I'm using the header file below. I'm a little confused about how to store any matrices I create... If I do: [code=php] int main() { Matrix A(2, 3); Matrix B(3); return 0; } Matrix::Matrix(int mdim_, int ndim_) { data_.resize (mdim_*ndim_); for (int i = 0; i < mdim_*ndim_; i++) { …

Member Avatar for Fbody
0
124
Member Avatar for Anarionist

ok so my code will output the message its suppose to if it doesnt receive any arguments and im 100% sure the problem is the if statement with the argv[1] because i always have problems with char type for some reason. :( [code] #include <iostream> #include <string> #include <sstream> #include …

Member Avatar for Anarionist
0
157
Member Avatar for moods125

[CODE]# include <iostream> using namespace std; void init(int *Ptr, const int &s); void display(int *Ptr, const int &s); void sort(int *aPtr, int s); void swap(int *v1Ptr, int *v2Ptr); int index_of_next_smallest(int *aPtr, int *SiPtr, int s); int main() { int size, count; int *nPtr; cout << "Enter the size: "; cin …

Member Avatar for Fbody
0
141
Member Avatar for kangarooblood
Member Avatar for igodspeed

Hello, I am not able to compile it on windows. It compiles fine in linux but not on windows. Well actually it compiles if i change a few things but there are many linker errors. Could someonline please tell me where the problem is at. Thanks [CODE]// Project: B*-trees floorplanning …

Member Avatar for mitrmkar
0
241
Member Avatar for wilsonz91

Hi, My problem here is that, I want to add up the total of the few different items that are entered. I have no idea how to add them up, please offer some suggestions, thanks [CODE]#include<iostream> #include <windows.h> using namespace std; float weightcount(float w); float distancecount(float d); int main(void) { …

Member Avatar for wilsonz91
0
170
Member Avatar for _siren2

I've been coding a little program which works perfectly, but I decided to upgrade it and add a few checkboxes. Now since i've never made one before I'm having trouble and I can't seem to find anywhere that can solve my problem. [code] void TheAppDlg::OnFirstcheckbox() { if(OnFirstcheckbox !=0) { m_cCharSet.SetWindowText(_T("123")); …

Member Avatar for Ancient Dragon
0
310
Member Avatar for webdragon89

[CODE]#include <iostream> using namespace std; class sMatrix { public: sMatrix(int,int); sMatrix (sMatrix&); int getR(); int getC(); bool rValid(double); bool cValid(double); void setEl(double,double,double); double getEl(int i,int j); int getVal(); void print(); void add(sMatrix&); private: int nr, nc; //number of row and cols int nent; //number of entries int nmax; //the max …

Member Avatar for Nick Evan
0
268
Member Avatar for ybkumar77

Hi I am using Rougewave library for one of my program. I am using the RWHashTable from it. during the startup of my program, I will load this hashtable with information read from database. so, I have the hashtable filled with data. and during runtime, I need to print all …

Member Avatar for ybkumar77
0
138
Member Avatar for johndoe444

Hi, This is the code segment: [CODE]template<class type> void merge_sort(type inputs[], int p, int r, int (*comp)(type, type)); typedef struct { vertex vertices[MAX_VERTEX]; int number_vertices; int adj_matrix[MAX_VERTEX][MAX_VERTEX]; } graph; int compare_vertex(vertex v1, vertex v2) { if (v1.f < v2.f) { return -1; } else if (v1.f > v2.f) { return …

Member Avatar for mitrmkar
0
249
Member Avatar for wendell_

Hi all, I am trying to write a small game with a tiled gameplay area. I have a vector of Tile objects - vector<Tile> area_tiles; - and I'm trying to add Tile objects to this vector like so: [code] Tile t(); // initialize new tile object area_tiles.push_back(t); // and add …

Member Avatar for mitrmkar
1
113
Member Avatar for Anarionist

MSG msg ; HWND hwnd; WNDCLASS wc; to me this syntax looks like msg hwnd and wc(all lower case) are variables is this right? and with the exception of wc would changing the other 2 change anything?

Member Avatar for mitrmkar
0
90
Member Avatar for aswin cp

Can someone help me with the code to display the second largest value in a set of numbers using '[B][U]while loop[/U][/B]'??? I have done programs using [B][U]while loop[/U][/B] to display the largest value, as well as the largest and smallest value.But this seems a bit tough for me.

Member Avatar for tintin.iitk
0
273
Member Avatar for webdragon89

I have the following code: my add function and M.add(N) statement keeps turning up errors I'm not sure how to fix it. I also need a getVal function but I'm not sure what to do with it. [CODE]#include <iostream> using namespace std; class sMatrix { public: sMatrix(int,int); int getR(); int …

Member Avatar for Nick Evan
0
113
Member Avatar for Sonic42

Here's what I'm trying to do: I want my program to spawn a Msgbox on the first day of every month with some information for the user. Please walk me throught it EXACTLY, as I'm a beginner :icon_mrgreen:

Member Avatar for Nagarajshet
0
85
Member Avatar for tintin.iitk

e.g. [CODE] class B { public: virtual ~B() {printf("Base class Destructor");} }; class D { public: ~D() {printf("Derived class Destructor");} }; [/CODE] Is it somehow possible to altogether avoid printing 'Base class Destructor' when an object of class D is destructed (of course without causing a memory leak).. If you …

Member Avatar for tintin.iitk
0
2K
Member Avatar for TaroYamada

Now, I am sure there are more than 3 problems with this thing, and it's been sort of butchered into pieces with me attempting to solve this issue. Regardless, outside of the three problems I'd appreciate any input. My book tasks me with creating a program for a zoo that …

Member Avatar for Anarionist
0
86
Member Avatar for dude1

i have my file input like this ifstream inFile; inFile.open(fileName.c_str()); and i cin >> fileName; i want the output file name to be the input filename with .dat added to it eg if fileName was c:/tmp/test.txt i want the output to be c:/tmp/test.txt.dat anyone know how i can do this …

Member Avatar for dude1
0
95
Member Avatar for clutchkiller

Is there another reason besides having a clean, easy to read source file then to use overloaded functions? Thanks

0
57
Member Avatar for bibhu_trekking

i have a c++ project..i am having project titled "3d animated car".i need u to help me in writing the documentation section of project....i m also sending the program source code..... [code] #include<graphics.h> #include<conio.h> #include<dos.h> #include<stdlib.h> #include<process.h> void main() { int gd=DETECT,gm; initgraph(&gd,&gm,"c:\\tc\\bgi"); int c=12; setbkcolor(0); //setlinestyle(0,1,2); int t; while(1) …

-2
42
Member Avatar for clutchkiller

[code] #include <iostream> using namespace std; int main() { double var1 = 0; var1 = 2/10; cin.ignore(); cin.get(); return 0; } [/code] Its not setting var1 to .2 it is keeping it at 0. wth? it does 10/2 = 5, but then it does 2/10 = 0.

Member Avatar for clutchkiller
0
105
Member Avatar for ruin

[code] #include"stdio.h" #include"conio.h" #include"process.h" #include"ctype.h" #include"string.h" #include"io.h" #include"fcntl.h" #define length 1 struct StudentInfo { char studentid[8]; char lastname[15]; char firstname[15]; char middlename[15]; char gender[6]; char birthdate[15]; char age[3]; char contactno[15]; char guardian[30]; char address[120]; }; struct tmp { char studentid[8]; char lastname[15]; char firstname[15]; char middlename[15]; char gender[6]; char birthdate[15]; …

Member Avatar for jonsca
0
110

The End.