49,761 Topics

Member Avatar for
Member Avatar for countrygirl1970

I am in Advance C++ and trying to add a class to this program that I wrote for my lab. Could someone help me to understand more on class objects and help me on this code cause I am losing my lunch on this. Thanks, Melissa [code] #include <iostream> using …

Member Avatar for countrygirl1970
0
128
Member Avatar for earlyriser

Hello I'm trying to assign a value from a string via some pointer, but I got an error and I cannot figure how to solve it. Do you have an idea? I would really help me. The problematic line is marked between ********* Thanks. [CODE]// reading a text file #include …

Member Avatar for ~s.o.s~
0
288
Member Avatar for n.aggel

i have 10 different classes-objects that are controled by a another class{call it Central class). All 10 classes need to write to the same file(not at the same time). Is it better to have central class control the stream and pass it to the other classes, or each class should …

Member Avatar for Lazaro Claiborn
0
104
Member Avatar for niceliang84

im newbees in doing C++ program, now i face a problem where i need to open more than one ".dat" file in a single program. the coding that i use is... ifstream input; input.open("Luc.dat"); if (input.fail()) { cout<<"Unable to open a file \n"; exit(1); }//end if while(input>>keyword>>index2) {//write to Alphabet …

Member Avatar for Ancient Dragon
0
144
Member Avatar for RisTar

hi , im pretty new to computer science and alose to this community . i have a problem that im trying to solve and hope you guys can help me with it . im trying to create my own version of the function "atoi" that can be found in stdlib …

Member Avatar for RisTar
0
246
Member Avatar for himanjim
Member Avatar for GreenDay2001
0
71
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
133
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
125
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
270
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
111
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
303
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
321
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
118
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
170
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
98
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
153
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
215
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
122
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
170
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
247
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
797
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
394
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
151
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
248
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
302
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
680
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
109
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
145

The End.