51,593 Topics

Member Avatar for
Member Avatar for Shabazz120

What output is generated from the following code: cout << 2 * (5.0/2) << endl;

Member Avatar for cambalinho
0
79
Member Avatar for andrew mendonca

Here is the website for the assignment I am working on: http://view.samurajdata.se/rsc/5c1dd0b4/ Here is the website for my header file (MixedExpression.h): http://ideone.com/oJ6mI8 Here is the website for my library source file (MixedExpression.cpp): http://ideone.com/inEyqe Here is the website for my calculator client file (Calculator.cpp): http://ideone.com/EDTWeS The header file is correct. I …

Member Avatar for rubberman
0
215
Member Avatar for margaretbn

#include<stdio.h> int main(){ printf("hello world"); getch(); return 0; }

Member Avatar for Learner010
0
100
Member Avatar for Nines

how do i put a password, change password on my code because everytime i put it in, my program don't shows it it just jumping to my selection menu, and how do i delete informations that ive put on my program? this is my code. thank you in advance. [CODE] …

Member Avatar for kdevesh
0
4K
Member Avatar for Tewhano

Thanks to Muschops and Schol-R-LEA I finally got my program working. However I decided to change my file format and replace the underlines with spaces and separate the data with a comma. I open the file and use getline to grab the data but I have an error that reads: …

Member Avatar for Tewhano
0
3K
Member Avatar for Syafiq_1

write a program to request two integer number,x and y. If x falls within the range of -2 and 7, y is either 5 or 10, then the program will display ""within range". Otherwise the program displays "out of range".

Member Avatar for Syafiq_1
0
179
Member Avatar for Tewhano

I am trying to read from a text file and input the data into a struct. I have read through all the threads on this topic and have not been able to work out where I am going wrong. My text file is: > Plain_Egg 1.45 Bacon_and_Eggs 2.45 Muffin .99 …

Member Avatar for Tewhano
0
134
Member Avatar for skyyadav

given int a[]= {3,2,7,6,8,1,4,5} vector<int> v(a,a+8) use the stl copy algorithm to display the last 5 integers in the vector to cout with each integer on a seperate line. copy takes three argument. third argument is output container. In this case it is v.but v already have 8 elemenst. How …

Member Avatar for mike_2000_17
0
194
Member Avatar for kay19

Question: Well I have to input a number correctly with comma's and a decimal. My input would be 243,111.11 and the output would come out as 2,43,,111.11 Do I have to create additional for loops statements for each digits and check for comma's/decimal? I almost scrapped this code for attempting …

Member Avatar for kay19
0
252
Member Avatar for zozzooo

I have an application this is already license but in this application use my functionality put custom .afl file this file make in c++ make this .afl file as trial period.So how to make this .afl file as 7 day trial period.....i am beginner so plz help me...

Member Avatar for Ancient Dragon
0
227
Member Avatar for yatman

I can't understand why this doesn't work, but when i enable char *s=s1 and use s wherever s1 is used it returns the correct output. char *mystrncat(char *s1,const char *s2, size_t n ) { // char *s=s1; while(*s1!='\0') { s1++; } while(n!=0 && (*s1++=*s2++)!='\0') n--; if(*s1!='\0') *s1='\0'; return s1; }

Member Avatar for Ancient Dragon
0
98
Member Avatar for PulsarScript

Hi to everyone.Can somebody help to : Write a program to display all the hour and minute values in a 24-hour clock from 00:00 to 23:59.

Member Avatar for deceptikon
0
136
Member Avatar for andrew mendonca

Here is the website for the assignment I am working on: http://view.samurajdata.se/rsc/5c1dd0b4/ Here is the website for my header file (MixedExpression.h): http://ideone.com/oJ6mI8 Here is the website for my library source file (MixedExpression.cpp): http://ideone.com/RSrshS Here is the website for my calculator client file (Calculator.cpp): http://ideone.com/U5F2O8 My question: I got the code …

Member Avatar for Schol-R-LEA
0
151
Member Avatar for SolidSora

I'm trying to write a program that prints out all prime numbers from 1 to 300. It isn't working the way I want it to. Right now it appears to have caused an infinite loop. Here is my code. [CODE]#include<iostream> #include<iomanip> using namespace std; int main(){ for(int i=0; i<=300; i++){ …

Member Avatar for Mahfuz_1
0
320
Member Avatar for baconswife

I am writing a program that outputs whether or not a number is prime. Can anyone help me find where my syntax error is? Also, i get that i = 3; i <= num; i++ would be true for it being a prime number from the other forums I have …

Member Avatar for Mahfuz_1
0
199
Member Avatar for Shinedevil

[code]#include <iostream> using namespace std; long int math; long int check; long int divider = 1; long int inputnum; void dividerp(); void counter(); void inputp(); void dividerp(){ math = inputnum/divider; if (math == 1 or inputnum == 2 or inputnum == 1){ cout<<"You do have a prime number there!"<<endl; system("PAUSE"); …

Member Avatar for Mahfuz_1
0
399
Member Avatar for boogeyman77

I'm in serious need of help with a C++ based prime number generator. I have the program to create and run the code, but i dont have the knowledge to develop the code and I'm looking for one of you guys to build the code for me. I need a …

Member Avatar for Mahfuz_1
0
641
Member Avatar for khelkely

Q1: Trace the partial of program below: 1. int v = 8, *r, *s; 2. int *p; 3. int q = 100; 4. p = &q; 5. r = p; 6. *p = 20; 7. p = new int; 8. *r = 30; 9. q = v; 10. s = …

Member Avatar for tinstaafl
0
157
Member Avatar for DuffManLight

Downloaded and installed latest RE2. When building simple test code with Xcode 5, build fails. #include <iostream> #include <string> #include <re2/re2.h> using namespace std; int main(int argc, const char * argv[]) { unsigned long ulValue = 0L; string sMultiple; string sMatch = "^(\\d+)([KkMm])"; string sData = "2M"; if (RE2::FullMatch(sData, sMatch, …

Member Avatar for phorce
0
287
Member Avatar for cambalinho

see these class: class test { public: void virtual Created(){} void test() { Created(); } }; class test1 : public test { void Created(); void test1(): test { Created(); } } test1; void test1::Created() { cout << "created test1"; } (these code wasn't tested, but you get the point) can …

Member Avatar for cambalinho
0
196
Member Avatar for Rawan_92line

i want to know what should i do first , or the main points that i should start with pleaes help me :( Project: General Distribution Center This project aims to develop a C++ program that support a General Distribution Center using object oriented concept. The General Distribution Center has …

Member Avatar for Rawan_92line
0
258
Member Avatar for jvasher

Should I loop through tiles and delete each one? Or is there a better way? if(tiles->at(i) != NULL) delete tiles->at(i); std::vector<Tile*> tiles; //TODO: need to fix this to match sprite sheet tiles size for (int y = 0; y < 10; y++) { for (int x = 0; x < …

Member Avatar for Lucaci Andrew
0
248
Member Avatar for reverend818

i need help with a complete source code for c++ program for newton raphson method .the program should have these attributes;one double data member,class,and also have a constructor to initialize the data member as it cannot be negative. The function should return the square root of the data member. The …

Member Avatar for mike_2000_17
0
391
Member Avatar for willgr

WinHttpGetProxyForUrl always returns ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT when I test it with the below code. See [url]http://msdn.microsoft.com/en-us/library/aa384122%28VS.85%29.aspx[/url] for what I have tried to base this on. Can anyone see any flaw in my code that causes this error to always return? I have tested it with many pac files and this is always …

Member Avatar for Massimo_1
0
1K
Member Avatar for SpottyBlue

I'm having a vowel count problem when I build the code. #include <iostream> #include <string.h> using namespace std; char str1[51]; int vowelA = 0, vowelE = 0, vowelI = 0, vowelO = 0, vowelU = 0; int vCount() { int ii; // Counter cout << "\nResult: " << endl; cout …

Member Avatar for nullptr
0
157
Member Avatar for asundar

Hey everyone, So, I need help understanding why I'm not able sort my code: here is my code (so far) for my selection sort. I have only written the iterative form of Selection Sort, but I know how to do it recursively as well (which is required for my homework). …

Member Avatar for tinstaafl
0
835
Member Avatar for owen99

hi can anyone help me i am trying to get a random character generator which generates 10 characters in ASCII range and then cast them into characters heres my code but its not working. it says error C2440: '<function-style-cast>' : cannot convert from 'std::string' to 'char' heres my code [code=c++] …

Member Avatar for Anilorap
0
1K
Member Avatar for Daneil

how to write an algorithm that converts deceimal to binary, using mod , div and an array to display the answer

Member Avatar for tinstaafl
0
302
Member Avatar for anonlearner

I hace to design a fucntion that draws lines of charaters to create a picture, like a trangle or something. The parameters are: 1) The symbol (letter or blank) 2) The line length(the number of charaters of that symbol) 3) An end line flag to incate the new line started …

0
128
Member Avatar for theguitarist

Hello, I have a graph that is represented in the form of a grid. For example: V--V --VV V---V VVVVV Each V is a node. If there is another V above/below/to the side of a V then there is an edge between them. I'm to form one single connected component …

Member Avatar for gusano79
0
154
Member Avatar for nhrnjic6

OK.So i need to bild this table and so I did.But what I cant understand is why it works fine till I hit number 18.then sudenly like half of 1st number-s (array[x]) are missing. can someone please tell me whats the trick.Thank you. #include <iostream> using namespace std; int main() …

Member Avatar for Schol-R-LEA
0
280
Member Avatar for Saurav Akolia

on running any program in dev c++ screen cannot hold and it close in very few second what i do for holding screen

Member Avatar for Moschops
0
138
Member Avatar for redkowloon

Hi all, My lecturer give an assignment Calculate student assessment and final exam work . The program can accept a name , registration no, course code and couse name as an input Input mark :- Final Exams : 40% Quizes : 15% Test : 15% Lab Exercise : 30% Sum …

Member Avatar for Schol-R-LEA
0
217
Member Avatar for offshoreworker

I have a .csv file that could have anywhere from 50 rows to over 10,000. The first 32 rows (geographical header information) will always be ignored. The 2nd column of data will have 0.00 for (x) rows. Once that column starts to read a value I want to start storing …

Member Avatar for Kfd
0
203
Member Avatar for sathya.N
Member Avatar for skyyadav

I am reading these values from a file 12.1 13.4 12.4find gg 16.77 56.55 My program should display the average of 5 float no and ignore find and gg. I did while((inputfile >> f)) { //cout << "ssss"; //continue; //} sum += f; count ++; cout << fixed << f …

Member Avatar for Banfa
0
981
Member Avatar for Jumper_1

[Click Here](http://www.gov.hk/en/residents/immigration/images/smartcard_front.jpg) Below are the steps for generating the check digit. 1. The first letter of the card number is converted into a number based on its position in the alphabetical sequence (i.e., A = 1, B = 2, C = 3, …, Z = 26), and is multiplied by …

Member Avatar for Jumper_1
0
412
Member Avatar for skyyadav

I am reading these values from a file 12.1 13.4 12.4find gg 16.77 56.55 My program should display the average of 5 float no and ignore find and gg. I did while((inputfile >> f)) { istringstream iss(f); if(!(iss(f)) { iss.clear(); continue; } sum += f; count ++; cout << fixed …

Member Avatar for tinstaafl
0
316
Member Avatar for davenie.neymar

1. Please write 1 simple C++ program to calculate any number and the operation you should do is: -add, minus,divide,multiply 2. Please write a program C++ that can accept user input ( ex.student name, address, date of birth etc..) in Character Data Type. Once, the input has been entered, it …

Member Avatar for Lucaci Andrew
0
204
Member Avatar for deep.chanda1

Here is a very simple program which is actually not working properly in Dev c++; When i compile the program it shows 0 errors,yet it doesn't run completely. Whreas if i run the same one in Borlan c++ it runs to completion,no problem. What to do such that it works …

Member Avatar for Saurav Akolia
0
410
Member Avatar for elliotell333

HELP Why wont this work? // Test.cpp : Defines the entry point for the console application. // #include <iostream> using namespace std; #include "Apstring.h" #include "apstring.cpp" int main() { apstring Game; apstring rndnum; apstring rdy; system("color a"); system("Echo GREETINGS PROFESSOR FALKIN"); cout << endl; cout << "WOULD YOU LIKE TO …

Member Avatar for tinstaafl
0
244
Member Avatar for strongard63

there is something that I can not understand in the following code: int main() { int count = 0; int x=125; while(x!=0) { count++; x=x/10; } } if x is 125 so x=x/10 gives 125=12,5 which is something odd and impossible. what is the meaning of x=x/10??? what is x=x/10????? …

Member Avatar for strongard63
0
2K
Member Avatar for Daneil

am wrting a password program in c++ but its not working, some error, says "missing function header (old-style formal list?)" #include "stdafx.h" #include <iostream> using namespace std; int main(); { int password = 1234; int password2 = 0000; int x = 0; cout << "Please enter the password2"; cin >> …

Member Avatar for Lerner
0
226
Member Avatar for zozzooo

hii I have make an application as trial period .In this application contain .afl file it Contain my functionality and this file make as trial period i am beginner in this so please help me....this .afl file is make in c++....plz help..

Member Avatar for jwenting
0
153
Member Avatar for Gà_1

Here is my few successful program: #include<iostream.h> #include<conio.h> //============================================================================== void main() { short int n,i,j,k,max; int m[50]; i=0; j=0; k=0; max=-32767; cout<<"Value of length: "; cin>>n; for(i;i<n;i++) { cout<<"Value "<<(i+1)<<": "; cin>>m[i]; if(m[i]>0&&m[i]%2==0) k++; if(m[i]<0&&m[i]>max) { max=m[i]; j++; } } cout<<endl<<"Number of natural even value: "<<k<<endl; if(j>0) { cout<<"Position of …

Member Avatar for Gà_1
0
249
Member Avatar for jvasher

I am trying to make sure that I delete all memory allocations from the new command, ran into 1 problem and I'm not sure If I understand when how the delete in a destructor of a class will be called. Problem: I create a class in main, after the game …

Member Avatar for mike_2000_17
0
185
Member Avatar for VUEKID

I need a little help to store two strings into a vector and reversing the order of each string. i.e. 123456789 needs to be 987654321 12345 needs to be 000054321 reason for that is I need to add those two numbers together.

Member Avatar for deceptikon
0
329
Member Avatar for acmarshall

Hello all, I am not sure what's wrong my code but, when I run my program it keeps going to my default switch statement. I would like my program to keep looping the menu until I put in the quit function. Can someone please tell me what I'm doing wrong? …

Member Avatar for HiHe
0
10K
Member Avatar for andrew.mendonca.967

CSCI 15 Assignment #3, introduction to classes/objects. 100 points, due 10/21/13 A mixed expression is an expression of the form a + b/c, where a, b, and c are integers, b >= 0 and c > 0. By convention, b/c is always non-negative, and has the property that 0 <= …

Member Avatar for tinstaafl
0
342
Member Avatar for skyyadav

How to know the name of process in the other process? or who started that process.

Member Avatar for richieking
0
142

The End.