51,593 Topics

Member Avatar for
Member Avatar for lochnessmonster

when i create an empty project...my compiler is saying _TCHAR* is undefined...what file do i need to include to fix this problem? [code]#include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { //blah blah blah return 0; }[/code]

Member Avatar for Ancient Dragon
0
81
Member Avatar for gavGaz

Hi all, I'm using a vector to store x,y,z values for objects to be draw using OpenGL. I manipulate my vector in a function and then pass it to the method which uses it to draw objects. Basically the value at an element is supposed to be '-2' but if …

Member Avatar for jonsca
0
79
Member Avatar for thehivetyrant

Hi guys, As the title says i have 3 boids, all given a number (0,1,2) by way of [B][I]i=0, i<3,i++[/I][/B] Later on i'm assigning a certain boid to turn red when it gets within range of it's target boid. At the minute its only turning red when it comes within …

Member Avatar for sfuo
0
95
Member Avatar for vbx_wx

How can i rewrite set::inser() function,using a vector::insert() : [code] class Set { std::vector<T> set; public: void insert(const T& t) { set.insert(set.end(), t); } [/code] I tried to insert them at the end,but it wont work corectly.

Member Avatar for dexblack
0
141
Member Avatar for Transcendent

[COLOR="Red"][B]The flowchart is on the attachment. Please check it out[/B][/COLOR] [COLOR="Red"][B]I also get this error: error: cannot convert `__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >' to `char' in assignment|[/B][/COLOR] [CODE]/*************************************************** The following program will take user's input and check whether it is in the following language: <S> ---> a <B> | …

Member Avatar for mike_2000_17
0
329
Member Avatar for jackmaverick1

Hmmm... I'm trying to call a class and it doesn't work and i get this error /home/XXXX/Desktop/language/main.cpp|13|error: expected constructor, destructor, or type conversion before ‘.’ token| The syntax is: [CODE] print.base="print"; [/CODE] this simple method call returns an error. Am i really doing something wrong, seeing as i've already looked …

Member Avatar for jackmaverick1
0
121
Member Avatar for caltech

[CODE]#include <iostream> #include <cmath> #include <iomanip> using namespace std; int divides(int,int); int main () { int count = 10; //int prime = divides(count); int p = 0; // number of primes cout.setf(ios::fixed,ios::floatfield); cout << setw(6) << "NUMBER" << "\t" << setw(8) << "DIVISORS" << endl << endl; while (count<=50) { …

Member Avatar for caltech
0
126
Member Avatar for pseudorandom21

[url]http://www.boost.org/doc/libs/1_46_0/libs/smart_ptr/shared_ptr.htm#ThreadSafety[/url] This section somewhat confused me, in my code I have a matrix of shared_ptr's pointing to an entirely thread-safe class. But the shared_ptr documentation says it is only as thread-safe as the built-in C++ types. Does this mean that if I read/write to my thread-safe class using shared_ptr's at …

Member Avatar for mike_2000_17
0
185
Member Avatar for cppgangster

Hi, is here any other issues then readability between two functions below? [CODE] void getNames(int) { .... } void getnames(int meaningfullName) { static_cast<void>(meaningfullName); ... } [/CODE]

Member Avatar for cppgangster
0
112
Member Avatar for poloblue

Good Afternoon, Can someone help me with this program which is an assignment for a class. I'm new to C++ its my fist course in computer science. The assignment details are: 1. The function removeAt of the class arrayListType removes an element from the list by shifting the elements of …

Member Avatar for poloblue
0
2K
Member Avatar for gavGaz

Hi all, I'm trying to create code which manipulates data within a vector. The vector contains floating points which store consecutive 3D values. For example element 1 stores object 1 x coords, element 2 - object 1 y coords, element 3 - object 1 z coords, element 4 object 2 …

Member Avatar for Fbody
0
168
Member Avatar for i_luv_c++

Hey guys! I am working on a project using single linked list and currently on the last task which is overloading the += operator. My merge from a+=b is inefficient because I am having a memory link problem and its slow when it used in list size of 100000. Please …

Member Avatar for WolfPack
0
622
Member Avatar for lashatt2

will find number which is used frequently(often) in x array [CODE]int i; int x[i],frequency[i]; for(int i=0;i<3;i++) { cin>>x[i]; frequency[i]=0; } frequency[i]=0; for(int i=0;i<3;i++) { frequency[i]++; cout<<x[i]; } frequency[i]++; cout<<x[i]; cout<<frequency[i]; [/CODE] what should I do extra

Member Avatar for VernonDozier
0
118
Member Avatar for SolidSora

I'm trying to make a program where it displays the users name based on what they entered. For example if the user enters: John Average User the output would display User, John A. And if the user enters John A. User the program would output User, John A. The problem …

Member Avatar for atticusr5
0
110
Member Avatar for stereomatching

compiler gcc4.5 minGW OS : windows xp sp3 I try something like this [code] template<typename T, typename U> class fastRowSum { public : fastRowSum(); typedef void result_type; //what is this line for? template<typename inputItr, typename outputItr> void operator() (T const VALUE, inputItr ref, outputItr out) { error = VALUE > …

Member Avatar for mike_2000_17
0
228
Member Avatar for pato wlmc

SORRY FOR THE NOOB QUESTION, but until some time ago (1 or 2 weeks) all my programs we comand-line, so I didn't have to... build them(?) But some days ago, i decided to create a program with GUI, and I used QT creator for that. Now My program is finished, …

Member Avatar for pato wlmc
0
118
Member Avatar for derek123

I am really trying to pass this class, and am simply struggling majorly with C, I need help with these 3 problems that are due today by midnight, please help, will appreciate it greatly, and even pay if thats what it takes. I did problem 1, but used math.h, which …

Member Avatar for Ezzaral
-1
604
Member Avatar for daviddoria

I have been using a [icode]Image<Node>[/icode] as the main object to store the data for my program. It is a 2D grid of Node objects. The nodes have properties like [icode]bool Visited[/icode], [icode] float Priority[/icode], etc. I often want to modify these nodes, put some of them in a vector …

Member Avatar for daviddoria
0
167
Member Avatar for canadiancoder

Hi Folks, I'm hoping this is a trivial question with an equally trivial answer. I've got a C# program that I'm experimenting with, which simply passes an array of doubles and the size of the array to a C++ DLL. The DLL will then simply add 500 to each element …

Member Avatar for canadiancoder
0
136
Member Avatar for madval88

I have saved a 2D matrix in a numpy file (.npy) in python. Is there a way I can access the same from C++ and possibly read in the values in a stl vector? [URL="http://www.scipy.org/C++_Extensions_that_use_NumPy_arrays"]This [/URL] is vaguely relevant. But here you make the call from python. I want to …

Member Avatar for madval88
0
769
Member Avatar for mrgreen

hello, I'm fairly new to programming in general, and i'm having some trouble figuring out how to use a stack and queue to check to see if a word or certain order of numbers/letters form a palindrome or not. My logic is to read in the original string, push/pop characters …

Member Avatar for biljith
0
177
Member Avatar for maikens

Hi all, I have written a balanced binary search tree as part of an assignment (make a simple Spell Checker). Each node has, among other values, two height ints, leftHeight and rightHeight, to keep track of the heights of any subtrees. My problem is that after a rotation, the heights …

Member Avatar for maikens
0
1K
Member Avatar for Transcendent

I'm supposed to write this c++ that take in 01 and on. for example: 01010101 but not 0,1,10,011,110. Can someone help me figure out what I need to do to fix the problem. [CODE]#include <iostream> #include<stdlib.h> // for the exit(1) function using namespace std; char text[300]; char ToBeChecked; char lexical(); …

Member Avatar for caut_baia
0
152
Member Avatar for Vanquish39

[CODE] #include<iostream> #include<vector> #include<string> using namespace std; struct Item{ string itemName; double cost; }; class User{ public: User() : itemList(0) {}; User(string a, string b) : fN(a), lN(b) {}; void addItem(Item a) {itemList.push_back(a);} vector<Item> getItems() const {return itemList;} void printUserInfo(); private: string fN; string lN; vector<Item> itemList; }; class Convention{ …

Member Avatar for Fbody
0
153
Member Avatar for maikens

Hi all, I wrote this recursive function to set the heights of each node in a search tree. It is not performing as expected; I suspect I screwed up the recursion somehow. Anyone know what the matter is? [CODE]void AVLTree::SetHeight(NodePtr &node) // root is passed in { if(node == NULL) …

Member Avatar for mrnutty
0
143
Member Avatar for Stefano Mtangoo

If I'm not mistaken using library that is GPLed will force your app to go GPL. Is there a way to get away with MySQL GPL licence and use it in closed source (Not necessarily commercial)? Two scenarios here: 1. libmysqlclient is linked dynamically 1. libmysqlclient is linked statically Thanks!

Member Avatar for Stefano Mtangoo
0
452
Member Avatar for shantanusinghal

[CODE=c] int main(int argc, char *argv[]) { ifstream inHandle; Assembler obj; if(argc!=2) { cout<<"InvalidInput ERROR"; } else { inHandle.open("test.asm"); if(inHandle==0) cout<<"FileNotFound ERROR"; else obj.pass1(inHandle); } inHandle.close(); return 0; } [/CODE] this is my code for the main() function, i have tried entering the filename in every possible format but the …

Member Avatar for Narue
0
641
Member Avatar for Smithy566

I'm trying to compare two DateTime objects, but I am receiving the following error. error C2664: 'System:: DateTime::Compare' : cannot convert parameter 1 from 'System:: DateTime ^' to 'System:: DateTime' I'm just trying to use the DateTime 'Compare' method to perform the check. Below is an example to illustrate what …

Member Avatar for jonsca
0
2K
Member Avatar for Lemonader

Hi. It's actually not a C++ code, it's a matlab code. But I hope there's somebody here who can help me. There's not really an appropriate forum here for a matlab code. It's about Gaussian Elimination [url]http://img189.imageshack.us/i/50468910.png/[/url] I already have a code that only needs to be modified. [code] clear …

Member Avatar for peter_budo
0
133
Member Avatar for halleluijah

Hi everyone, I have wirte a programme to display the Palindromic prime, i.e 2,3,5,7,11,101,131,151.......... but I don't know what's wrong with my code, it can only display the number up to 11 and then no response. Could yuou help me to check out what's wrong? thank you so much. Here …

Member Avatar for pyromania
0
279
Member Avatar for Dundir

Hello, I'm working on a Pyramid Problem. I got it working, but it took a huge amount of time. How should I tackle a problem like this in the future. I don't think it should have taken me 4 hours but I had the most horrible time getting the formatting …

Member Avatar for WaltP
0
81
Member Avatar for spoonlicker

I have no idea at all, nothing, on how to make a full, running and working snake game. I tried starting off using character symbols in ASCII to draw its head and body, but from there on I have no clue on how to make it move with out having …

Member Avatar for kayhantolga
0
358
Member Avatar for jasoncastro

Hi again! is there any way a program can read a .txt file without typing the .txt extension name? I need this for my ATM program for accessing an account number, it wouldn't look right if i have type 1234667.txt. I'm using Borland C++. Hope you can help me! Thanks! …

Member Avatar for jasoncastro
0
345
Member Avatar for txwooley

I am completely new to C++. I have a function that deals cards for a blackjack game. To do this, I need to call this function 10 times (two cards each for 4 players and a dealer). But it just deals the same card to everyone. I think it might …

Member Avatar for WaltP
0
154
Member Avatar for lochnessmonster

if i want to inline a member function do i need to have it in both places below(decleration and implementation section)? or can i just place it in implementation section only or decleration section only and get the same result? class Ray { public: inline allocate( const int Lize ); …

Member Avatar for mike_2000_17
0
134
Member Avatar for LexLieberthal

My friend needs a program that will: 1. Ask the user for the size of the matrix. The choices are 2x2 or 3x3. 2. Ask the user for the operation to perform. The choices are addition or subtraction. 3. Let the user input the numbers for the first matrix. 4. …

Member Avatar for LexLieberthal
-1
148
Member Avatar for Alice1990

This is a file named InBoundData.txt [TEX] 1 B777 850 Paris KL 9395 11.40 am 6 2100 2 B747 900 Lon KL 10000 12.30 pm 7 2100 3 A380 900 LA KL 16800 10.30 am 15 2750 4 A340 850 CapeTOWN kL 9580 12.10 pm 6 3000 5 A330 800 …

Member Avatar for Alice1990
0
360
Member Avatar for LuciaPwNs

So here is cliff notes of my assignment: -Use Inheritence -Person(lname, fname, address) inherited by employee(rate, hours) What I would like to do: -Find how long my arrays have to be(depends on file length) -open file -go to function retrieve lastname from file -go to another function retrieve firstname ...etc …

Member Avatar for prvnkmr194
0
193
Member Avatar for SacredFootball

[CODE] #define cinGetValue(value,status) \ { \ string inputLine; /* raw user input text*/ \ istringstream convert; /* string converstion variable.*/ \ \ getline(cin,inputLine); /* get a string of data from user input (could be empty) */ \ convert.str(inputLine); /* load 'convert' with user input */ \ convert >> value; /* …

0
76
Member Avatar for failbot

So, I'm writing an implementation of List in C++ as a programming exercise, so far I have this: [CODE]#include <iostream> #include <algorithm> using namespace std; template <class T> class Link; template <class T> class List_iterator; template <class T> class List { public: typedef List_iterator<T> iterator; List(); List(const List<T> & l); …

Member Avatar for failbot
0
350
Member Avatar for tdba.316

After a few months of learning and practicing C++ with the book C++ Primer Plus through Chapter 7, I decided to do myself a little simple program. I started with the decision to try splitting my program into multiple files, and I decided to collect all shared declarations/definitions (*) into …

Member Avatar for tdba.316
0
2K
Member Avatar for jasoncastro

Hello I'm new at using c++ and new at this forum as well, I'm wondering if you could help me with my atm project. Could you please show how to make my program accept pin number but display ***** or any other character,[ICODE][/ICODE] instead of showing numbers when inputting them? …

Member Avatar for jasoncastro
0
2K
Member Avatar for lianpiau
Member Avatar for rbduck09

Can someone please explain it saying that warning C4700: uninitialized local variable 'd' used? Enhance the Quadratic program in the following manner. If the user enters a valid set of coefficients (the else” case compute the value )of the discriminant d, defined as: d = b^2 - 4ac If the …

Member Avatar for rbduck09
0
224
Member Avatar for akase2010
Member Avatar for Muhammad Sumair

How can i get graphics.h header file and put it in my Visual C++ 6.0 directory ??

Member Avatar for Muhammad Sumair
0
183
Member Avatar for lochnessmonster

How do i prevent a C string input from the user from exceeding the capacity of the array? is this not possible? [code]int main() { char buffer[8]; printf("enter a string"); scanf(%s,&buffer); return 0; }[/code]

Member Avatar for navedalam
0
75
Member Avatar for sharksaw40

Hi I have recently learned c++, I'm 14 and want to get started on developing software. The problem is I'm too young to get a career in programming but I would like to start now partly to make it easier in later life and partly because I enjoy programming. The …

Member Avatar for sharksaw40
0
282
Member Avatar for yeahyeah85

Hi, i am trying to write a program for my homework. Write a function, lookupPrice that uses the product code to look up for the price. If the product code is on special promotion, a 10% discount is given. If the product code is found, the function returns the price, …

Member Avatar for yeahyeah85
0
96
Member Avatar for Dasharnb777

I have 5 strings, such as: "one", "two", "three", "four", and "five". I need to get all permutations of these words. I've explored all internet resources, but all solutions are so bulky and it's hard for me to understand it and integrate it to my program. So, maybe you know …

Member Avatar for Momerath
0
2K

The End.