49,757 Topics

Member Avatar for
Member Avatar for ured

I am trying to read a decimal as a char and store it in an array by ignoring "." like if I have 0000.9876 will be stored as 9876. The program works fine...but it doesn't stop when i debug it.....I need help please ........... #include<iostream> #include <ctype.h> using namespace std; …

Member Avatar for jonsca
0
105
Member Avatar for Noopur7
Member Avatar for gaurav sinha
-3
248
Member Avatar for luskbo

I trying to write a program that uses a getline to read from a txt file. I need it to read from the file until it reaches a line that has "$$$" in it. I can get it to read in the file like this no problem. [CODE] //assuming all …

Member Avatar for mrnutty
0
178
Member Avatar for robertmacedonia

Hello to all, can anyone please explain to me the following: I know how to use the copy constructor, I know that it's used only in the initialization, when i wanna initialize a new object using an old object... But what I don't understand is how will I know when …

Member Avatar for mrnutty
0
134
Member Avatar for samsons17

i not sure what is the single quote means... the example like this : if (value=='a') Thank you 4 helping :)

Member Avatar for mrnutty
0
79
Member Avatar for jhanthem

for the XsineX function I have to calculate xsinx for each value in x then store in result. I need to call on the sin function to do calculations. I tried but I know its completely wrong, any help please?? [icode] #include <iostream> #include <cmath> using namespace std; // uses …

Member Avatar for vmanes
0
163
Member Avatar for ukbassman88

Could someone please help me figure out what is wrong with my program? # include <iostream> # include <string> using namespace std; void water_state(); float celsius_to_fahrenheit(float c); float celsius; float fahrenheit; int main() { float celsius; float fahrenheit; cout << " Enter Temperature in degrees celsius: "; cin >> celsius; …

Member Avatar for vmanes
-1
79
Member Avatar for samsons17

Hi.. Is that possible to us to set the range using the switch statement? For example i want to do this : if ph==7 is neutral if ph<7 is acidic if ph>7 is alkali could i just write like "case ph<7 :" i know i could do the case one …

Member Avatar for vmanes
0
126
Member Avatar for gretty

Hello I am not sure if my function below will completely delete a linked list. I am worried it will delete every element of the list except for the head(first node)? For example; If I have this linked list below [QUOTE] L -> 1 -> 2 -> 3 -> 4 …

Member Avatar for mrnutty
0
86
Member Avatar for axed

Sorry for a duplicate post. The other post had gotten messy and since I was not allowed to delete it, I am starting a new post. Hi, here are the errors I am getting when i compile on cygwin. It is weird that the code compiles and runs perfectly on …

Member Avatar for axed
0
209
Member Avatar for Bunda350

ran into a problem i know this is asking for me to calculate the product of a coulmn and row but im not sure where to begin. I know that rowData tells us the value in a row and nRows specifies the number of rowData and the same with nCols …

Member Avatar for axed
0
210
Member Avatar for Bunda350

I want to test the code i wrote which is part of my assignment double sine(double x, double tolerance, int & limit) { int a = 1; double b = x; double z(0.0); do { b=(-z*x*x)/((2*a)*(2*a+1)); z=b; z+=1;} while(fabs(b-z)>tolerance); limit= a; return b; } im supposed to use a main() …

Member Avatar for Bunda350
0
248
Member Avatar for wardensmat08

Hi, I'm having a little problem in my loop with the string array. I want to take a record for some student, but when I loop the function, the getline() did'nt work. It only work at the first loop, then it will skip it. My code is like this [CODE]#include …

Member Avatar for wardensmat08
0
172
Member Avatar for thetechguy

I'm newish to c++ and even newer to ubuntu I tried linking and this is what I got: g++ -o calculator *.o -lcrypt -lm main.o: In function `main': main.cpp: (.text+0x1ea): undefined reference to `SAMSErrorHandling::Initialize()' main.cpp: (.text+0x2fa): undefined reference to `SAMSErrorHandling::HandleNotANumberError()' main.cpp: (.text+0x322): undefined reference to `SAMSPrompt::UserWantsToContinueYOrN(char const*)' collect2: ld returned …

Member Avatar for thetechguy
0
188
Member Avatar for UKmason

I have gotten started on my while loop but I'm kinda stuck I dont know where to go from here :( My assignment is to write a program to read in 6 numbers from the keyboard and then indicate whether any of them were larger than 500 or smaller than …

Member Avatar for jonsca
0
134
Member Avatar for Towely

I know this is probably a really easy question, but my teacher failed to mention how to do it, so here goes. I'm making a simple program that tells a user if a sequence of given numbers are even or odd. Here's what the program should look like: [CODE]Enter a …

Member Avatar for Towely
0
142
Member Avatar for snehil_khanor

Hey.. I wanna make a calculator .. which takes input as a string... example: Input : "1 + 2" Output: 3 "1+2" is passed as a parameter which is in the format of a string. The return value is 3 which an integer format. calculator needs only to perform +,*,-,/ …

Member Avatar for snehil_khanor
0
5K
Member Avatar for axed

Hi, here are the errors I am getting when i compile on cygwin. It is weird that the code compiles and runs perfectly on Visual Studio. $ g++ -o mainUnix.out mainUnix.cpp [code]mainUnix.cpp: In function `int main()': mainUnix.cpp:47: error: expected primary-expression before numeric constant mainUnix.cpp:47: error: expected `;' before numeric constant …

Member Avatar for axed
0
168
Member Avatar for jesseb07

hey, had a question that I couldn't figure out. I'm writing a program for linux and I need to save things to a person's Desktop. Because of that, I need to know their username. I am aware of the linux commands whoami, id, etc, but they only print the current …

Member Avatar for jbennet
0
8K
Member Avatar for thetechguy

I'm reading this one book on c++ and am having difficulty making an executable. I'm a n00b at c++ and Ubuntu so I don't know what I'm doing wrong. I've compiled all my cpp files into object files and now I need to link it but when I try that …

Member Avatar for thetechguy
0
117
Member Avatar for Sallad

For part of my assignment, we are to write a function that overloads the * operator so that we can multiply 2 list<short int>. We are given the BigInt.h and part of BigInt.cpp (It'd be easier if we didn't have to use this format, I know, but we're supposed to …

0
121
Member Avatar for GPXtC02

i'll start typing a command in the telnet module to communicate with my telnet server after i've already been connected and the server will suddenly drop me, exit telnet, and bring up the cmd prompt. what in this code is doing this? [code]void do_handleclient(int connsock,struct sockaddr_in *client_addr) { // Communicating …

Member Avatar for GPXtC02
0
104
Member Avatar for axed

I wrote a program to solve a system of linear equations. It works fine with the VS compiler. But when I try to run it using Cygwin, I get a seg fault(core dumped). But it does not say where the seg fault is. I am using the following commands: to …

Member Avatar for axed
0
314
Member Avatar for harryhaaren

Hey all, I'm currently struggling a bit with GUI building. What i want is a simple "click the button & a new widget appears" effect. Now how to go about implementing that i dont know. I've thought about storing each instance a widget in a std::vector. Seems a little messy …

0
50
Member Avatar for Shinedevil

I don't know where you sould put resources on this website so i'll just post it here. Also, if anyone can find the reason this program crashes occasionally and reply back, i'd be greatful! Thanks in advance. *Reminder: I'm not pro This is a simple(?) program that allows the user …

0
99
Member Avatar for kevindappah

Hello everyone, Im new to this forum and hope you all are doing well. Im currently developing mods for half life 2 (basic changes to game play but more level design stuff) I want to improve my skills and learn everything that I possible can. I really like the programming …

Member Avatar for kevindappah
0
179
Member Avatar for abraham james

if anyone could please help me with the c++ coding of the following:- Write a c++ program that does the following:- Accepts as input n(to be entered at run time and n must be divisible by 3) integers and stores them in a Stack, sort them using any sorting algorithm …

Member Avatar for Clinton Portis
0
100
Member Avatar for StaticX

Cant seem to find the solution to this although its probably starting me straight in the face. Iv been at this for a few days now,can anyone help me spot the bug? [CODE]// test the bool #include <iostream> using namespace std; main(){ int turn; int var=2; while(var!=1){ cout << "1 …

Member Avatar for snehil_khanor
0
96
Member Avatar for copry

A company pays its employees as Managers (who receive a fixed weekly salary), hourly workers (who receive a fixed hourly wage for up to the first 40 hours they work and “time-and-a-half,” i.e., 1.5 times their hourly wage, for overtime hours worked), commission workers (who receive a $250 plus 5.7% …

Member Avatar for snehil_khanor
0
115
Member Avatar for godsgift2dagame

Hey guys, I've got one more thing to ask about. How would I go about sorting by "words" rather than characters. In my program, I "read" strings, not characters and yet if I try to "sort" by words, it ends up just sorting the letters in that word. So "Benny …

Member Avatar for Clinton Portis
0
222

The End.