51,593 Topics

Member Avatar for
Member Avatar for himanjim
Member Avatar for GreenDay2001
0
76
Member Avatar for jobra

Hi all, I am trying to use the class as a vector and pass parameters to the class. In loop.run(), I do certain things, then I would like to delete all the elements of the class. [code] 1 class SampleMarketDataClient 2 { 3 .... 4 }; 5 int main() 6 …

Member Avatar for John A
0
136
Member Avatar for bigben09

Hey i need with this program it works, but i cant figure out how to make it not print out zeros when it is reversed. for example when the user types in 123000 it should print out 321. but my program prints out 000321 what can i do to make …

Member Avatar for John A
0
128
Member Avatar for bigben09

is there a way to tell the program to remove a certain charecter or number from a string with out giving it a position. for example i have a program that asks the user to enter a set of numbers and the program reverses the order of the numbers. so …

Member Avatar for ~s.o.s~
0
274
Member Avatar for superlox3

I don't understand strings at all. I looked at the tutorial but I still don't get it... Is there any tutorial that can be easily followed for inputting strings (no skimmers)? -Superlox3

Member Avatar for Lazaro Claiborn
0
114
Member Avatar for wparker

hi, i'm using c++ in cygwin environment under win32 .my classes use the xercesc c++ libraries which i have built with cygwin on windows. my c++ source code compiles into .o files but the linker just wont work. my LIB env. variable is set to /cygdrive/c/lib , lib directory exists …

Member Avatar for Lazaro Claiborn
0
321
Member Avatar for n.aggel

[code] enum MenuOptionInitial { TEST_ONE = 1, TEST_TWO, TEST_THREE}; switch(selection) { case TEST_ONE: //.... case TEST_TWO: //.... case TEST_THREE: //.... } [/code] the problem is that i want to have another selection base on other options [code] i.e. enum MenuSecond { TEST2_ONE = 1, TEST2_TWO, TEST2_THREE}; switch(another_selection) { case TEST2_ONE: …

Member Avatar for n.aggel
0
324
Member Avatar for live_atl

Consider the two equations p = cos(p), p = sin(p) with solutions 0.7390851332151607 (approximately) and 0 respectively. Implement three programs for the solution of these two equations. (a) Fixed point iteration: pk+1 = g(pk). (b) Fixed point iteration with Aitken acceleration. (c) Steffensen’s acceleration. In each case, begin with p0 …

Member Avatar for Lazaro Claiborn
0
120
Member Avatar for iaaan

Hey, i am trying to do a sort in C++. I have a strucutre of different records such as Quote number, Surname, Total cost and Deliverycost. I am trying to sort in order of Quote Number. Im using a bubble sort to do this: [INLINECODE] for(i = 1; (i <= …

Member Avatar for iaaan
0
172
Member Avatar for Joe689

[COLOR=#0000ff]for[/COLOR][COLOR=#000000] (i = 0; i < length; i++)[/COLOR] { [COLOR=#0000ff]for[/COLOR] (j = 0; j < width; j++) { [COLOR=#0000ff]for[/COLOR] (k = 0; k < height; k++) { interpolated_1D[i* j *height + k] = interpolated_input[i][j][k] ; } } } Doesn't seem to work,,, What am I doing wrong... Everything is allocated …

Member Avatar for Joe689
0
2K
Member Avatar for jobra

Hi all, I want to write every given number of lines into the different files, which I will be passing as an command line argument. I have written a function for just dividing the file into two, but how would I divide the files for every given number. If anyone …

Member Avatar for Salem
0
106
Member Avatar for im4tion

Hi. I have a bunch of Java codes I have done and I was wondering if there is a possible software or program to convert it into c++? This is because I've done it in Java and now my lecturer wants it to be in c++ >< The concept is …

Member Avatar for Infarction
0
156
Member Avatar for unclepauly

i have a BaseClass and a DerivedClass. i need the BaseClass to register a glut callback, but i need the DerivedClass to determine what the callback does. heres the code: (.h) class BaseClass { public: BaseClass(); ~BaseClass(); protected: static void _renderCallback(void); virtual void Render(); }; (.cpp) BaseClass::_renderCallback(void) { Render(); } …

Member Avatar for thekashyap
0
233
Member Avatar for raydogg57

For this assignment I need to implement a c++ class that creates a ring buffer. A ring buffer still uses an array, but its has two indices, i..e., the head and the tail. Note: The head is the index of the first data point, and the tail by definition is …

Member Avatar for John A
0
2K
Member Avatar for abhishekmittal

Hello friends, Can anyone plz tell me the difference between a using declaration and using directive ? I know this: A using declaration adds a particular name to the declarative region in which it occurs. whereas, A using directive makes all the names in the namespace available without using the …

Member Avatar for John A
0
126
Member Avatar for Duki

Hey guys, I need help again :sad:. I'm doing really well in the class, it just seems like these past couple assignments have been really rushed (i.e., we went over chapter 5 the day after I finished reading chapter 4 =/). I'm getting sort of discouraged, because up to now …

Member Avatar for Duki
0
173
Member Avatar for SHWOO

I have overloaded the << & >> operators and I though I could access private data members of the class if I declared the functions friends of the class. I am getting four errors in the two overloaded functions that are trying to access the private members firstName and lastName. …

Member Avatar for iamthwee
0
249
Member Avatar for dalton

ok so im scanning this text file for the string "model=" the problem is, i need to pull the numbers after that string until it reached the end of that line, this is an easy script but for some reason its just not happening. If someone smarter than myself could …

Member Avatar for iamthwee
0
806
Member Avatar for Monyet

How do you create static methods using C#? How do you specify each items in the static methods? thanx.. I'm a C# newbie >.<

Member Avatar for Monyet
0
127
Member Avatar for Marks256

I am just curious about the pros and cons of each. Please leave your opinion(s). Thanks! (sorry the question is so broad, but i just wan the pros and cons of each.)

Member Avatar for Marks256
0
413
Member Avatar for n.aggel

hi, to get the current time you use this statement: [inlinecode] time_t now = time(0); [/inlinecode] i was wondering how can i check the time stored in this variable if it falls in a specific time interval, i.e. between 5 and 6 am. I am thinking one way to do …

Member Avatar for Ancient Dragon
0
153
Member Avatar for himanjim

Unsigned char is 1 byte long.. it's range is from -128 to 127 Most significant bit is sign bit to indicate whether the char has positive or negative value and the rest 7 bits are meant for storing the actual value of char... so the max +ve value of char …

Member Avatar for Ancient Dragon
0
251
Member Avatar for Duki

Hey all, here is the part of my code I need help with: #include <iostream> #include <iomanip> using namespace std; int main() { int acctNo, dayMin, nightMin, tmin; double amtDue; char serviceCode; cout << "Account Number: " << flush; cin >> acctNo; What I'm wanting to do is, if someone …

Member Avatar for WaltP
0
304
Member Avatar for rhythm

Hi everybody, this is my first post to the community and I need your help. I have a final project that I am working on for my C++ programming class. The functional particulars are: [LIST] [*]Program must be command-line based and interactive, allowing the user to control its operation by …

Member Avatar for John A
0
708
Member Avatar for sharpyC

[COLOR=#0000ff][COLOR=#000000]I am new to these forums and message boards, but I am trying to do a C# windows application Lab and cannot get the code correct for the button's click event which will Cube a "double" number entered into an adjacent textbox. Also, another textbox is supposed to return the …

0
48
Member Avatar for nadith_cs

is there a library to manipulate the output or like ncurses in linux, in visual c++ in windows? or else tell me a way to move the cursor according to the coordinates x & y......like ncurses in linux.

Member Avatar for Ancient Dragon
0
110
Member Avatar for CurtisBridges

I have written a program that work as supposed to, except the output needs to be in 2 cols. instead of 1 col. in console. Could someone help me to format this? Below is the program and the output I need to change. 14.14.cpp : Defines the entry point for …

Member Avatar for Infarction
0
148
Member Avatar for bigben09

hey what would a basic string program look like, can some one show me? what would I need to do to make the numbers the user inputs in, go into a string? [code=c] #include "stdafx.h" #include <iostream> #include <ctype.h> #include <fstream> #include <string> using namespace std; int reverseDigit, integer; int …

Member Avatar for Infarction
0
115
Member Avatar for bukaj

HI, can somebody help with this? This is my source code but i was trying to overwrite it, from C to C++. but no way, I'm not good at this. Language doesn't matter. it's slovak. I just need help with syntax. Thanks. [code=c] #include <stdio.h> #include <stdlib.h> #include <stdio.h> #define …

Member Avatar for bukaj
0
171
Member Avatar for Lazaro Claiborn

Hello, I've recently, inadvertently, found incentive to write my own Tic-Tac-Toe game. I've been working on it for more-or-less 15 minutes and would like some help or a point in the right direction. It is almost finished but there is a function, namely the "_scan4Winner" function, that I must write …

Member Avatar for Lazaro Claiborn
0
469
Member Avatar for tinie

I encounter problems in inserting elements in a 2d vector. For example I want to insert 99 in v[2][5], how would I do it? What I have is this code (example given by Narue in [URL]http://www.daniweb.com/techtalkforums/thread70093.html[/URL]) [code= c++] #include <iostream> #include <iomanip> #include <vector> int main() { std::vector< std::vector<int> > …

Member Avatar for tinie
1
5K
Member Avatar for lotsofsloths

ok, i am going to *attempt* to make a tic-tac-toe kinda game... he is what i got so far.. PLEASE help it out!(i will update the code sometimes).. [CODE] #include <iostream> using namespace std; int main () { int line1; int line2; int line3; int line4; int line5; int line6; …

Member Avatar for Lazaro Claiborn
0
321
Member Avatar for torbecire

I am trying to replace all characters in text with char [*]. It only displays the first four. If i type anything after 6 digits it displays 5 [*]. Could anyone help me?. Look at the function twoplayer(w). Thats the one i am concerned with now [CODE=c] #include <iostream> #include …

Member Avatar for John A
0
106
Member Avatar for Duki

Hey everyone, I have a question on one of my homework problems. I'm in basic structured programming; C++. The question states the following: The root of the quadratic equation ax^2 + bx + c = 0, a ≠ 0 are given by the following formula: [U]-b +/- √b^2 – 4ac[/U] …

Member Avatar for Duki
0
2K
Member Avatar for SHWOO

I cannot figure out why I am getting these two errors error C2504: 'arrayListType' : base class undefined error C2143: syntax error : missing ',' before '<' [code] // Jon Wayman // class that is derived from arrayListType template <class elemType> class unorderedArrayListType: public arrayListType<elemType> { public: void insertAt(int location, …

Member Avatar for Narue
0
150
Member Avatar for ReDeViL

Hi guys need a little help for my homework, any help is greatly appreciated. :cheesy: Qn 1. pointers i have a problem with passing pointers to functions code is as follows: [code] //function declaration void computeProduct(product *pProduct,int *pBest); //function call computeProduct(product *pProduct,int *pBest); //function definition void computeProduct(product *pProduct,int *pBest) { …

Member Avatar for ~s.o.s~
0
228
Member Avatar for tinie

I have read that iterators are used to traverse through the elements of container classes. If I wanted to use iterators to move through elements of a 2d vector, how am I going to declare it and use it? Maybe what I said was not too clear, let me rephrase …

Member Avatar for Narue
0
4K
Member Avatar for Duki

Hi all I am new to C++ and have a few questions if that is ok. I would like to get into good habbits early (i.e., using switch instead of 12 if else statments) and was wondering if anyone knew right off how to get a timer to time the …

Member Avatar for Narue
0
141
Member Avatar for mrparthi

I am using Intel D915GAV Motherboard with Windows XP SP2. While try to use TCPP (C++), the screen becomes blank and hangs. when i open the task manager and fount that NTVDM.exe utilizes 90-95% of the CPU. After i end the task of NTVDM.exe then the system works fine. I …

0
41
Member Avatar for soveijn

i dont have any code yet because im not sure of the best way to go about doing this. 1. i have multiple dlls that i want to statically link to my program 2. when my program starts i want all the dlls to do their own intialization 3. i …

Member Avatar for soveijn
0
78
Member Avatar for trunks1212

Ok, I'm writing code for Tic-tac-toe game and I'm almost done I just can't get it to stop when Player 2 wins. It works fine when Player 1 wins or if there is a tie. I know it's short notice, but can anyone help me before tomorrow morning. I would …

Member Avatar for John A
0
163
Member Avatar for nadith_cs

this is a program which will help you to find the roots of any given function.... and please note that i have made comments on the lines which compiler gives an error. actually it compiles really well. i think it is something wrong in the values which are assigned to …

Member Avatar for iamthwee
0
112
Member Avatar for kobi

Hello , When im trying to compile this code it goes well,but when i run the prog i just get a flash of the cmd ,please can you tell me what i doing wrong?-im using the compailer of dev c++ [code] #include <stdio.h> #include <stdlib.h> #define _WIN32_WINNT 0x0501 #include <windows.h> …

Member Avatar for Ancient Dragon
0
395
Member Avatar for Rickenbacker360

Hey again, I was hoping someone here could look at my code and tell me why I'm not receiving the correct output. Here's what I'm supposed to do:Write a program that asks a user to enter an integer, say n,then list all the numbers that are less than or equal …

Member Avatar for psycotic_furby
0
123
Member Avatar for tinie

I am currently programming in Linux using the g++ compiler. I was trying to make an open function that would open a file and store its contents in a 2d vector. I was successful at doing the said function. I thought I was done with it, but I realized that …

Member Avatar for Lazaro Claiborn
0
135
Member Avatar for Tauren

Alrighty, ur in the game you click a NPC, you click to buy an item. It then sends a packet to the server seeing if you have enough money an so on if you do it sends a packet back? Would that be correct? If not can someone help me?

Member Avatar for WolfPack
0
127
Member Avatar for andy257

Hi All, I am starting out with learning the basics of C. Once i have learned that i would like to know how to make the programs look visually better. Things like drawing coloured boxes/ windows etc. One of my learning programs is a simple calculator. If i want to …

Member Avatar for ~s.o.s~
0
144
Member Avatar for degamer106

I'm having a bit of a problem with function style cast with classes. When I exit the function I expect an instance of Database to be returned. This instance would then be copied into the db declared in main. I've writtien a copy constructor and it works fine (tested by …

Member Avatar for Ancient Dragon
0
180
Member Avatar for ziman

Hi all, I have a project made in C code which generates the position and the velocity of a pendulum. I want to represent it in a graphic while the points are being generated but I don´t knom how I can do it or if it´s possible. I don´t know …

Member Avatar for Ancient Dragon
0
82
Member Avatar for GreenDay2001

In earlier versions of c++, there was a function gotoxy() which could take me anywhere in the screen. Its available with borland compilers now too but not with visual c++ express. Is there any substitute for that.

Member Avatar for GreenDay2001
0
486

The End.