49,761 Topics

Member Avatar for
Member Avatar for smrati.katiyar

i have written a class to add matrices ,line 51 of the code has problem. debugger is showing segmentation fault there . please suggest the correction. [CODE] #include <iostream> using namespace std; class mat { int row; int column; double **a; public: mat(){} mat(int r,int c) { row = r; …

Member Avatar for smrati.katiyar
0
121
Member Avatar for oliviars22

I need to read data from a file into an array of structs. The info is arranged in the file like so... Spear of Extreme Whaling January 1851 Captain Ahab Each member of the array has a name, month, year, and first and last name of creator. This is the …

Member Avatar for thelamb
0
256
Member Avatar for ghost_from_sa

Hi guys, Im pretty dam stuck at the moment on an assignment Im meant to do. Its my last question so everything is pretty laid out, but the question (to me is not useful) so if you could just help me out it'd be much appreciated Ok so what i …

Member Avatar for ghost_from_sa
0
975
Member Avatar for Akill10

Hey, I'm not too sure what the problem is here, I have never had trouble using fscanf before. The following shows the code I use to check the file, and the result. [CODE]while( true ) { int vals_read = fscanf(fileHandle,"%[^;];%s",&name,&pass); if( vals_read == 2 ) { // process the line …

Member Avatar for Akill10
0
167
Member Avatar for madrimer

I want to make a simple text program based on the game minesweeper that asks for the number of columns and rows, and asks for the number of mines then create the gameboard with the number of mines scattered throughout on standard output. Any help?

Member Avatar for Akill10
0
158
Member Avatar for yongj

I've been trying to code an array where its size is dynamically allocated. It's been a while since I've coded and so I was wondering if you guys could give me some help? There's also a randomize function that allocates the array with a random set of numbers (the quantity …

Member Avatar for ravenous
0
109
Member Avatar for Noxer

Im a fairly fresh programmer, and I often run into problems like most of us. Most of the time I get it solved in 10 minutes by some google power, but this time Im stuck for real (spent the last 4 hours looking around the web). I first ran into …

Member Avatar for ravenous
0
614
Member Avatar for hawita

Hi, I am trying to understand functions in my C++ class and i was wondering what would be an algorithm to evaluate function and find its maximum and minimum. If someone could explain this to me i would greatly appreciate.

Member Avatar for pseudorandom21
0
99
Member Avatar for C++ Beginner

Problem: Write a program that uses a loop to display the characters for each ASCII code 32 through 127. Display 16 characters on each line with one space between characters. I have tried solving this problem several ways. I either get blank screen or numbers 1-16. Can anyone lend a …

Member Avatar for furyrichie
0
2K
Member Avatar for dyingatmidnight

Just when I think I understand this stuff some else crops up to bite me. This part was supposed to be the easy part of the overall project so this does not bode well... What am trying to do is create an array of 32 variables that will be filled …

Member Avatar for mike_2000_17
0
277
Member Avatar for Theformand

I realize this is a pretty simple operation, however im totally lost, and no post I could find seem to touch on the exact same subject as mine. I have a text file, where each line is formatted like so: [CODE]float1,float2,float3,float4,float5,float6[/CODE] Each float is separated by a comma. The number …

Member Avatar for griswolf
0
155
Member Avatar for tc121091

This is my first time to use the string function. And I met some errors while doing the practice. We now need to input some words, until we input a word with 4 letters. Then the program will show the smallest and the biggest word among our inputs. e.g. Enter …

Member Avatar for tc121091
0
204
Member Avatar for CodyOebel

I am using the free alternative to SPY ++ known as Winspector, and was suggested to start using this to get more familiar with windows and handles and process handles etc... My question here is I notice when I put the crosshair over certain windows I get WINDOWS and a …

Member Avatar for WaltP
0
173
Member Avatar for NinjaLink

Is there a way to create a C++ program to rewrite a query in an optimal form without the use of a database such as storing information in arrays. If so, how? What can I do to implement this. Rewrite SELECT EMPOYEE.EMPNO, POSITION FROM EMPLOYEE E, JOBHISTORY J WHERE E.EMPNO …

Member Avatar for drkybelk
0
117
Member Avatar for kumarmpk4u

I am building a dll file. when i try to compile the dll file i get the following errors... help me am new to vc++... tool used is visual studio 6.0 GPPSCOM.OBJ : error LNK2001: unresolved external symbol "double __cdecl RoundDown(double,int)" (?RoundDown@@YANNH@Z) GPPSCOM.OBJ : error LNK2001: unresolved external symbol "double …

Member Avatar for kumarmpk4u
1
316
Member Avatar for sha11e

How can I check that the user actually is inputting what I want them to? (For example letters or numbers); I need the user to input y or n, so here is how i tried to solve it: [CODE] char answer; do { system("cls"); cout <<"Want to play? <y/n>: "; …

Member Avatar for Derek Elensar
0
155
Member Avatar for smrati.katiyar

[code] class complex { int real; int imag; public: complex(){}//why default constructor is always needed complex(int a,int b){real = a;imag = b;}// why can't we define only this constructor ~complex(){} }; [/code]

Member Avatar for Narue
0
724
Member Avatar for Eng_suha

This is the full code and the single error!!!!! 1>d:\s\o.o\hws\new folder\shop\shop\main.cpp(37): fatal error C1075: end of file found before the left brace '{' at 'd:\s\o.o\hws\new folder\shop\shop\shop.h(8)' was matched [code] #include<iostream> #include<string> using namespace std; #ifndef SHOP_H #define SHOP_H class Shop{ friend ostream &operator<<(ostream &output,const Shop &S){ output<<"\nThe name of the …

Member Avatar for Eng_suha
0
139
Member Avatar for zslgreen
Member Avatar for programing

i make twwo single linkedlist,, but i didn't know how i can merge those lists ;; [ICODE]#include <iostream.h> class linklist { private: struct node { int data; node *link; } *p; public: linklist(); void append( int num ); void appendd(int size); void display(); }; linklist::linklist() { p=NULL; } void linklist::append(int …

Member Avatar for arjunpk
0
242
Member Avatar for ninjatalon

I have an assignment where I need to Sort the linked list according to Int Variable after the user has input the information. When I try using bubble sort I'm stuck because I don't know how go back to the beginning. If a user enters : 5 4 3 2 …

Member Avatar for ravenous
0
131
Member Avatar for narunaru

I'm trying to make the quicksort but it's not working at all. I made a helper function "swap" so I can call it back in the "quick"function. then used recursive method to do it till the array is sorted. The problem is.. IT'S CRASHING EVERYTIME I RUN IT... i think …

Member Avatar for ravenous
0
149
Member Avatar for mattloto

Hey guys, so I just started learning computational geometry, and I decided to make a class for a Point and a class for a Ray. This is my code: [CODE]#include <iostream> #include <string> using namespace std; class Point { public: double x, y; Point(double x, double y) { this->x = …

Member Avatar for mrnutty
0
146
Member Avatar for sergent

I am making a program which includes comaring 2 numbers (int's) but later I want to call another windows function and it takes in CHAR not int. I need a way to convert my ints to char. I looked up this on internet and non if it worked. Do you …

Member Avatar for mrnutty
0
207
Member Avatar for Nandomo

Any tutorials on how to use CFile or any other, to open a text file, get what's inside into memory, e.x Link List, and then put it back into text file when done? Please link me or guide me through this problem. Trying to get a Payroll system going.

Member Avatar for Nandomo
0
113
Member Avatar for Howdydoody

Hey guys I have the following class code and i get an error in the addVertex method that says vertexList is not declared in scope but i dont know why. [CODE] #include <iostream> #include "DirectGraph.h" #include <string> #include <list> #include <vector> DirectGraph::DirectGraph(): vertexList(100) { } void DirectGraph::printShortestPath(int source) { } …

Member Avatar for Howdydoody
0
304
Member Avatar for VernonDozier

Here's a simple, though not the most efficient, program that flags and displays all prime numbers less than or equal to 1000.

Member Avatar for 014
0
778
Member Avatar for eskimo456

Hi I am currently primarily programing graphics applications and am still fairly new to this. I know the relevance and can see the advantages of making items a template especially with things such as collision detection. I was wandering is there any advantage/disadvantage to doing everything as a template? Obviously …

Member Avatar for eskimo456
1
120
Member Avatar for caut_baia

Hi everyone.I have a strange problem.I've written a class which handles registry keys and values of which there are two functions [code] template<> unsigned long RegistryEntry::GetValue <unsigned long> (std::string Name) { unsigned long Value; unsigned long DataSize; assert (RegQueryValueEx (Key,Name.c_str(),0,NULL,(unsigned char*)&Value, &DataSize)==ERROR_SUCCESS); return Value; } template <> char* RegistryEntry::GetValue <char*> …

Member Avatar for Ancient Dragon
0
271
Member Avatar for fglom

I'm trying to save everything to a .txt file with a new line after every string, but I can't get it to work for me. I tried using [ICODE]<<endl;[/ICODE] and [ICODE]"\n"[/ICODE] but it all gets written in a single line. So if I enter "John" for [ICODE]first[/ICODE], "Smith" for [ICODE]last[/ICODE], …

Member Avatar for fglom
0
173

The End.