- Upvotes Received
- 3
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
17 Posted Topics
[CODE]#include <fstream> #include <iostream> #include <cstdlib> #include<limits> using namespace std; int main() { ifstream fin; ofstream fout; fin.open("getfromthisfile.txt"); if(fin.fail()) { cout << "Input file opening failed.\n"; exit(1); } fout.open("sendtothisfile.txt"); if(fin.fail()) { cout << "Output file opening failed.\n"; exit(1); } int next; int largest=0; int smallest; fin >> next; smallest = …
This should do it...your condition loops because it will only check the first if staement..i think [CODE] do { cout << "... Are you a male or a female?..." << endl; cin >> gendercheck; if(gendercheck == "male") { gender = 2; } else if(gendercheck == "female") { gender = 1; …
ahh....so many lines...cant handle it...:'( well for starters..just by looking at it...remove semi-colons in your function in lines 82 and 103..
[B]>>I am getting the error x undeclared on line 26. What I currently have is [/B]is it because you didn't declare type variable in main?(int x)
well you almost have it..but some lines there are not neede... [CODE] #include <iostream> #include <string> #include <cstdlib> // for system using namespace std; int main() { int dept_code = 0; string wrongSelection; cout << "\nChoose a Department to Proceed. Enter Dept. No. (1,2, 3 or 4)\n"; do { system("CLS"); …
im sorry to ask this but, what kind of c++ ode is this? just curious
well if you look at your code closely particularly the do-while loop...you have only 2 do's and 1 while...and dont forget to pair all brackets {}
Hello.. Supposing that i have this code..i want it to end after a character is pressed..but i dont know what to add...i can end it if input is negative or zero..but not char..i tried some experiments but it will end up debug assertion fail..help would be great.. [CODE] // adds …
i have a code that reads lowest and the highest number with inputs that are all Integer but, once i have an input (ex. apple 200)...it wont read anymore, need help in what to input code that ignores letters [CODE]//reads numbers only ex. 100 200 300 int main() { ifstream …
You could add another function if(isalpha(str[count])) it checks if all input is alphabet, it is invalid...
Hello i have a code here that partially works...the point in the program is to store 10 array integers then outputs how many times that integer is entered ex. input: 1 1 1 1 1 2 3 3 2 99 output : 1 = 5 2 = 2 3 = …
err...include header ? [CODE]#include<windows.h>[/CODE]
OK..i tried to run it.. first...your case 1-5...remove the "single " [COLOR="red"]'[/COLOR] " then put bracket on each case [CODE] case 1: { //code here } break; [/CODE] then..your codes still buggy though..but no more error
good day.. i am starting to learn..and experiment in namespaces just simple one... calling void functions..then print f.h [CODE]#include<iostream> #include<limits> namespace A { void f() { std::cout<< "Testing \"void f()\""; std::cout<<std::endl; } }[/CODE] f.cpp [CODE]#include "f.h" int main () { A::f(); std::cin.ignore(std::numeric_limits<std::streamsize>::max(),'\n'); std::cin.get(); } [/CODE] g.h [CODE]#include<iostream> #include<limits> namespace A …
Hello... In strings i learned how to sort about numbers... the question is, how does one sort letters? there are some sort in alphabet here in Daniweb but i cant understand its process is Letter A > than Z? is the computer using ascii values? isn't A(65)< Z(90)? if in …
you could start by wrapping it and sate your problem...so others might help you and LOOK at where you placed your bracket(first) should be below main() right? and a whole lot of errors along the way.. Good Luck
The End.
Anyzen