48,986 Topics

Member Avatar for
Member Avatar for PDB1982

I had my code working properly, but once I added my last array, it goes through the compile and then errors out....and I'm not quite sure why.... [code] #include <iostream> #include <fstream> #include <cstdlib> #include <cmath> using namespace std; int main() { double num[100], sum, count, newnum[100]; int j,i; ifstream …

Member Avatar for PDB1982
0
81
Member Avatar for nats01282

Hi all im after a piece of code that allows the user to enter a fraction e.g 1/4 and have the code split that fraction into 2 seperate variables, e.g variable 1 containing the '1' variable 2 cantaining the '4' How would i achive this? My objective is to make …

Member Avatar for nats01282
0
161
Member Avatar for soroush68

There's a simple question? how to print the size of a variable without using functions like sizeof() ? for example if you were asked to write a program that prints size of int without using sizeof() with a resault as below: cout<<sizeof(int);

Member Avatar for bharath404
0
254
Member Avatar for sdgz747

I am trying to read a file into an array and set the min and max values. At this point in my program, I am trying to just read it into an array and then display that array. I still have more to do in the program, but I am …

Member Avatar for WaltP
0
106
Member Avatar for corby

Ok so this is my code below in my member function definition .cpp file. The problem is when I execute the program it will not let me fill the answer for the first question so for example the output is: Please enter the name of the receiver: Please enter the …

Member Avatar for corby
0
104
Member Avatar for gregarion

Hey guys for my assignment i have to write a program which checks the information inside a text file to make sure it is all integers and then convert the integers to roman Numerals. My program seems to have a bit of a problem and im not sure where exactly …

Member Avatar for r.stiltskin
0
176
Member Avatar for Q8iEnG

Hi mates :) recently I did this code: [CODE]#include <iostream> #include <windows.h> #include <string> using namespace std; int main() { int check = 1; string dir; string dir2; string name; cout << "Which directory is the file located?\n"; getline(cin, dir); cout << "\nWhere you wanna move it to which directory?\n"; …

Member Avatar for WaltP
0
149
Member Avatar for mithunp

Trying to write strcat function, kindly review the code and post the comments.[code]char* mystrcat(char* dest,const char* src) { char* ptr; ptr = dest; while(*dest++ != NULL); dest--; while(*dest++ = *src++); return ptr; }[/code]

Member Avatar for Ancient Dragon
0
99
Member Avatar for sandorlev

hello! i've just tried out lists in c++, but they're giving me some kind of problem. it has something to do with iterators but i'm pretty sure i'm using them the right way. anyway, here is the code: [CODE] #include <list> #include <iostream> int main(int argc, char* argv[]) { std::list<int* …

Member Avatar for sandorlev
0
151
Member Avatar for vbx_wx

[CODE] HKEY hkey; DWORD nSubKeys = 0; TCHAR name[MAX_PATH]; DWORD size = sizeof(name); FILETIME filetime; if(RegOpenKeyEx(HKEY_CURRENT_USER , "Software" , 0 , KEY_QUERY_VALUE , &hkey) == ERROR_SUCCESS) { if(RegQueryInfoKey(hkey , 0 , 0 , 0 , &nSubKeys , 0 , 0 , 0 , 0 , 0 , 0 , &filetime) …

Member Avatar for vbx_wx
0
120
Member Avatar for smitysmit

at the moment i have 2 answers to queations and the answers are 1,2,3 or 4 but i ow have to make it so the user has to put a work in like "Brazil" but i try to do the same as if the user puts "A" in and it …

Member Avatar for Robert1995
0
146
Member Avatar for Covert06

I know I'm going to be bashed at for this, just please read at least this much before you start yelling at me to read the faq or thousands of other posts online. Im having a problem clear screening for my school work since my teacher has a fetish for …

Member Avatar for Covert06
0
193
Member Avatar for mitch9654

Hello, I am trying to make a calculator that does multiplication, division, addition and subtraction. My problem is that when I have the two numbers that have decimals it goes wonky. Anyway, that program runs like this: 1. User enters equation 2. Unwanted characters get thrown out 3. If operation …

Member Avatar for chary8088
0
245
Member Avatar for artikapri

Any forward error correction (FEC) implementation in C++? i need it for my project. i converted character into ascii value then converting them into binary values.now i need to append error correcting bits. i m doing my project in vc++. following is part of my code: [CODE]array< array< int >^ …

Member Avatar for vijayan121
0
123
Member Avatar for method4ever

[code=c] #include<iostream> #include <string> #include <sstream> using namespace std; int main(){ int i=0, ii = 0, x; string input; //command to prompt user for amount of movies cout<< "How many movies do you want to add? "; getline(cin,input); //end command to prompt user for amount of movies //set up loop …

Member Avatar for method4ever
0
185
Member Avatar for Dio1080

Binary Search tree help Can somebody explain to me what this code is doing step by step?, thanks [CODE=Java] TREE-SUCCESSOR(x) 1 if right[x] ≠ NIL 2 then return TREE-MINIMUM (right[x]) 3 y ← p[x] 4 while y ≠ NIL and x = right[y] 5 do x ← y 6 y …

Member Avatar for mailmarwa
0
255
Member Avatar for angel19

hi, can anyone help me with my code, any help will be much appreciated. The design should follow object oriented principles and use the UML tools. It should be a board game based on a “Monopoly-style” board made of 36 squares. The game is for two players who first enter …

Member Avatar for mn.balakumar
0
3K
Member Avatar for jonyshub

Hi everybody! Sorry for my bad english! I have a matrix of integers with a maximum length 6 digits. I must to write program, that checks whether a number is found in the section above the main secondary diagonal of this matrix. I'm beginner in C + + and I …

Member Avatar for farag
0
142
Member Avatar for William Byrd II

Hello. I have been working on this program for some time, and it appears that I now have only one error (1 error 4 times). I will greatly appreciate it if someone could show me how to fix this error. Here are my errors: (phonebook.cpp is at the very bottom …

Member Avatar for chary8088
0
98
Member Avatar for vizionary2012

Hello i am a new member of this and i was trying to include a matrix effect similar to the one at the beginning of the movie and it involves using the iostream header file, is there any replacement for this file cuz i tried using ios, and iostream and …

Member Avatar for gerard4143
0
95
Member Avatar for EgyCoder

Why does seekg() work only in the first iteration, while in the second iteration it doesn't.?However I used it in previous cases and it worked perfectly. And yes, I'm using clear(), but still nothing shows up after the first iteration (the iteration of the big while loop that encloses this …

Member Avatar for EgyCoder
0
203
Member Avatar for bbrradd

I have to read lines from a text file and reformat them so that the first letter is uppercase and the rest are lowercase. I did that with no problem. also i needed to count the total words in the file, and did that easily.,but i also need to count …

Member Avatar for WaltP
0
1K
Member Avatar for LevyDee

[code] //declared my vector as vector<candidate> vecList; //pretty standard stuff //do some looping, gather info vecList.push_back(candidate(name,voteCount)); [/code] candidate is my class name. So instead of passing an object to push_back, I pass my class name using an overloaded construtor and it works just fine. Upon further investigation, I used an …

Member Avatar for LevyDee
0
76
Member Avatar for 3cats

Can anyone help me - The screen never pauses or stays put (after the end while) for the last 3 lines of code to display and the line right above the end while -totalinterestpd is not being written to the outfile I'm stumped. [CODE]while (MonthlyPayment <= LoanAmt) { MonthlyInterest = …

Member Avatar for WaltP
0
163
Member Avatar for Bart_sg

[code]#include <iostream> #include <iomanip> #include <string> #include <ios> using std::string; using std::streamsize; using std::setprecision; using namespace std; int main() { double Ib,I,V,P,F,pf,In; unsigned short int type; cout<<"Please select the type of power supply\n";//Allows the user to choose between single or three phase cin>>type; switch(type) { case 1:cout<<"You have chosen a …

Member Avatar for Mikstaslaya
0
162
Member Avatar for Lukezzz

source: [url]http://www.tamirgal.com/blog/page/SharpSSH.aspx[/url] Hi, This must be some basic C++ I am missing out of how to declare an instance ? I am trying to create an instance of a SFTP. I have added the .DLL file into my project and added the namespace. Sftp is found as a class in …

Member Avatar for Banfa
0
165
Member Avatar for aay

I know this has been asked before, but none of the threads I found helped me much. I am a beginner at C++ programming and need help figuring out why this doesn't work. [B]Question[/B]: e^x can be approximated by sum 1 + x + x^2/2! + x^3/3 + ... + …

Member Avatar for WaltP
0
3K
Member Avatar for sciwizeh

trying to use the code from an online book to learn OpenGL. i'm using Dev-C++, because i can't find a good way to get GLUT into VS 2008 PRO without muckin about in C:\windows\system32 which i try to stay away from. (any suggestions appreciated) so this is the code: [CODE=C++] …

Member Avatar for jephthah
0
664
Member Avatar for andrew80

Hi to all, THis is my first post here. I have a project to create a scientific calculator. i wrote a code and i need some help on how to proceed. The code i wrote is for +, - , * , / now i want to continue with x^y, …

Member Avatar for CppBuilder2006
0
876
Member Avatar for xofth

i want to delete a element from the array i use this logic but it is not working [CODE]#include<iostream.h> #include<conio.h> main() { int arr[5]; //10 element int array int key; // key to edit int length=5; //length of array clrscr(); for(int i=0; i<length ; i++) { cin>>arr[i]; } cout<<"Enter item …

Member Avatar for Narue
0
140

The End.