49,761 Topics

Member Avatar for
Member Avatar for connoisseurodg

I have been up for 24+ hrs, and am failing to see where I'm getting these junk numbers from? I know it's staring me right in the face, I just can't see it for the life of me!! Keep in mind this code is ugly and may make your eyes …

Member Avatar for adam1122
0
72
Member Avatar for lauren316

Please help me with this code! Here is the assignment. Project Specifications: Each part of this assignment is a piece of the next part--it builds upon itself. You should submit each part as a separate program. But, the final program is a complete program built upon all the other parts. …

Member Avatar for daviddoria
0
181
Member Avatar for tomtetlaw

how do i exicute python scripts in a c++ program? and what uses would it have?

Member Avatar for Duoas
0
107
Member Avatar for eduardocoelho

Hi folks, I tried to read some past threads in this forum but I didn't find one that solves the problem I'm dealing about. I have experience with Java/OO programming and I'm developing a project using C++ (I have some background with C/C++ programming but I'm messing around some issues …

Member Avatar for ArkM
0
229
Member Avatar for daviddoria

I am trying to write a pretty straight forward algorithm (agglomerative clustering), but the details are getting pretty hairy. (A cluster is simply a group of points. The idea is to take a list of points and decide which are "grouped" or "clustered" close together.) Here is the outline: Input: …

Member Avatar for daviddoria
0
114
Member Avatar for sara khan

Hii everyone:) I have written this code to do conversion between decimal to any base between 2 and 26.... But this is not working properly ca any one help me:confused [CODE] #include<iostream.h> #include<conio.h> void conversion(int no,int base) { int arr[10]={0}; int i=0; while(no>0) { arr[i]=no%base; i++; no=no/base; } for(int j=i;j>=0;j--) …

Member Avatar for Sky Diploma
0
128
Member Avatar for Soccerace

I writing a program to read several data lines in from a file then using functions to process the data. One of the function is giving me an error that i can't figure out. The following code works fine with "1/2". However there is a case when the '/' sign …

Member Avatar for Soccerace
0
67
Member Avatar for OffbeatPatriot

I'm making a game and the game works around a class I call Cyber_State. Every state of the game is a subclass of Cyber_State, for example the title screen you see when you start the game and the actual game. Every state has a member that is a pointer to …

Member Avatar for MrSpigot
0
97
Member Avatar for daviddoria

On the line [code] set<T>::iterator iter; [/code] I am getting "expected ';' before 'iter'" [code] #include <vector> #include <set> using namespace std; template <typename T> vector<T> UniqueElements(const vector<T> &V) { set<T> s; s.insert(V.begin(), V.end()); vector<T> Elements; set<T>::iterator iter; return Elements; } [/code] Can anyone see why? It compiles fine if …

Member Avatar for daviddoria
0
98
Member Avatar for C++ Obliviator

I'm working on a rather big program. Everything works fine:) , until I added this simple code: [CODE]int counter_x = 0; int* x = new int; for (int a = 1; a < plain_len; a++) //plain_len: int { int b = a; while ( b != 0 ) { x[counter_x] …

Member Avatar for C++ Obliviator
0
590
Member Avatar for CPPRULZ

My textbook says "Constructors cannot be virtual. (Think about it: constructors are called to create new objects. However, if you don't know what type of object you're trying to create, how do you know which constructor to invoke?)" but I am not sure what it means by this. Is it …

Member Avatar for ArkM
0
140
Member Avatar for TheFueley

Hello all, I am trying to make a linked list (class-based). I'm not sure if I went actually did it right. I get a compiler error on the segment of code that deals with printing the linked list to stdout. Here is the seqment in question. [code=cpp] // print contents …

Member Avatar for TheFueley
0
181
Member Avatar for Justmehere

What I wanted to ask is if its possible to insert a Combo Box inside a Splitter window ? I am not sure if this question is incorrectly posted in this group. Any resources would be greatly appreciated.

0
58
Member Avatar for CPPRULZ

Hello I have been trying to understand virtual functions for a while and when I made a program to demonstrate the use of virtual functions it didn't and someone gave me this piece of code that would demonstrate the proper way to utilize a virtual function: [code=c++] #include"derived.h" #include<iostream> using …

Member Avatar for CPPRULZ
0
123
Member Avatar for Technosapo

Hello Everyone. Having some problem with coding, and hoping that someone could help. I have a text file with input delimited by spaces. Something like this: TGP C 18 3.90 4737 JWW B 25 6.5 9630 Now I can open and read the file. Now I am trying to get …

Member Avatar for Ancient Dragon
0
123
Member Avatar for guest7

Hi, I am getting the following error when I am trying to initialize a 2 dimensional vector with 0's. I am not to figure out the reason. Any help is appreciated. [ICODE] std::vector<int> truth_table; std::vector<vector<int> > truth_table_col; double no_of_twos = 7; double base_two = 2; cout << "No of 2's …

Member Avatar for guest7
0
99
Member Avatar for iTsweetie

Hi again! I'm having problems with an assignment once again. It's asking us to write a program that takes in a phone number as a string in the form of (555)555-555. We're then to use the strtok_s function to split the phone number into the area code, prefix, and then …

Member Avatar for Ancient Dragon
0
133
Member Avatar for Argo54325

Hello, I'm working on a school project, and I'm so lost i can't even figure out how to start it. What I'm trying to start off with is just a simple console application that gets these settings: program.exe [switch] [path] [filespec]. how can i accomplish this? This is what i …

Member Avatar for Argo54325
0
160
Member Avatar for Hilariousity

Hi there! I keep getting an error stating error: expected unqualified-id before 'bool' when I try to compile this file [code=C++] #include "Data.h" #include <iostream> Data::Data() { } Data::Data(char aLetter, int anOrder) { letter=aLetter; order=anOrder; } Data::~Data() { } ostream& operator<< (ostream& out,const Data& someData) { out << "(" << …

Member Avatar for Hilariousity
0
2K
Member Avatar for mhaviv

I have a very simple program, a console application, that I wrote a long time ago under VS 2005 under XP. It worked perfectly OK. The program gets names and in the end prints them on the screen, until I do not enter a new name but only CR to …

Member Avatar for SeeTheLite
0
172
Member Avatar for moosoo

hi, where can i get all or most of the libraries for c++ and where do i place them?.....one more thing.....i have visual c++ how can i find out what libraries i already have...i dont see any library folder in the main folder....thanks

Member Avatar for SeeTheLite
0
67
Member Avatar for lehe

I perhaps have to resort to multiple thread programming to reduce computational time. I am now studying how to use POSIX library. I can access a cluster with 8 CPUs, each of which has one core. I was wondering how many threads to create would get approximately best time performance …

Member Avatar for tux4life
0
85
Member Avatar for drjay1627

just out of curiosity (definitely not because i have a deadline tonight lol) how does a plagiarism detecting software work? any ideas? i'm pretty sure the program compares run time... for example if i create an array in main [code] main(){ //create array and add numbers } [/code] then in …

Member Avatar for tux4life
0
100
Member Avatar for Scofield89

im working on the following program, #include <iostream.h> #include <math.h> void main() { float x,y,z; int s; bool b; cout<<"x"<<'\n'; cin>>x; cout<<"y"<<'\n'; cin>>y; cout<<"s"<<'\n'; cin>>s; if(x==y) z =0.9; else z=0.8; cout<<"z="<<z<<"\n"; b=s%100; cout<<"b="<<b<<'\n'; x=3; for(int i=1;i<=3;i++) { x*=2; cout<<" "<<i<<" "<<x<<'\n'; } } and it gives me 3 warnings: truncation …

0
12
Member Avatar for Cyken

Hey guys, i am very new to C++ but i know some little things about it. I am trying to make a simple dos program with simple arithmetic but i forgot how to do some things since it has been ages since i last coded. I am trying to make …

Member Avatar for Cyken
0
109
Member Avatar for tomtetlaw

i am making a list template for a tutorial, heres the code: [code=c++] template<typename t> class list { int sz; t elem; public: list() : sz(0), elem(new t[0]){ } list(int i) : sz(i), elem(new t[i]){ } list(int* i, double val) : sz(i), elem(new t[i]) { for(int i=0;i>sz;i++) elem[i] = val; …

Member Avatar for Intrade
0
105
Member Avatar for Carrots

Hi! I was hoping for some advice on how best to create a single doubly-linked list which could contain all of the different types of classes I have. This is the code I have written so far.... [B]shape.h:[/B] [code=C++] class Shape { public: Shape (int l=0, int h=0) : length(l), …

Member Avatar for Intrade
0
124
Member Avatar for devfolarin

i need help on some code im having trouble with its an x and o ai i havent finished the strategy function. im running a linux os and i need help with a segmentation fault also some help to make the code better would be appreciated //dtai-II //concept by temi …

Member Avatar for SeeTheLite
0
84
Member Avatar for longmatt

Hi guys, I am going mad. I am trying to code an algorithm in C++ and already at a very early stage there appears an error that I just don't understand... These are the error messages sent by the VC++ compiler: [code] \surface_watershed_matlab\surf_watershed.cpp(138) : error C2653: 'CMesh' : is not …

Member Avatar for longmatt
0
109
Member Avatar for Lukezzz

I use rand() to generate random numbers between 0-50. However when I use the code, as I have seen it, rand() doesn´t truly generate random numbers. It seems that everytime I restart the application, it generates the same random numbers everytime. It seems that there is any mathematical sequence the …

Member Avatar for DavidB
0
139

The End.