49,757 Topics

Member Avatar for
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
506
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
156
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
240
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
166
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
308
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
247
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
84
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
84
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
94
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
108
Member Avatar for NathanOliver

would the workings of strlen() be something like this? [code=c++] int strlen(const char * str) { int size = 0; while (!!*str) size++; return size; } [/code] any feedback would be appreciated. also i have learned that !! will convert a value to an actual bool eg. !!104 = 1

Member Avatar for Ancient Dragon
0
145
Member Avatar for isralruval

i know the following function is not correct, but its suppose to read a text file(which containts the words "hello all") and pass it to a Vector called V1 and then encrypt it and pass the encryption to a second vector called V2 and finally output the result into a …

Member Avatar for VernonDozier
0
67
Member Avatar for corby

hey does anyone know if i am using the srand() fucntion correctly to randomly choose if a persons letter is X or O? [CODE]#include <iostream> #include <cstdlib> using namespace std; int main() { srand(time(0)); int playerTurn = rand() % 2; char initPname; if (playerTurn == 1) { initPname= 'X'; playerTurn++; …

Member Avatar for corby
0
137
Member Avatar for crozbme

//I am trying to use the reverse function but only get garbage when trying to print s2. How do I properly assign s2 a value in order to print it in main? #include <iostream> #include <string> using namespace std; class ch_stack { public: void reset() { top = EMPTY; } …

Member Avatar for crozbme
0
76
Member Avatar for jimJohnson

I hope this doesnt constitute as me asking for answers but I am running a program and at the end I am asked for the program to wait 10 seconds after saying goodbye and prompted back to main menu. I have researched this on google and from some of the …

Member Avatar for necrolin
0
152

The End.