49,761 Topics
| |
isalpha and ispunct work punctiliously, but isspace spaces out. [CODE] cout << "Please enter an integer: "; cin >> str; int bogus = 0; for (int i = 0; i < str.length(); i++) { char temp = str.at(i); if (isalpha(temp) || isspace(temp) || ispunct(temp)) { cout << "Please try again!" … | |
This code : ...line 6... [code] #include "FileToVector.h" #include "VectorToIntArray.h" #include <string.h> #include <iostream> using namespace std; int main(int argc, char *argv[]){ char* in = argv[1]; FileToVector ftv = FileToVector(in); vector<char> v = ftv.fileToVector(); VectorToIntArray vt = VectorToIntArray(v); //int* a = vt.letterFrequencies(); cout<< v.size(); return 0; } [/code] produces this … | |
HI, I'm relatively new to programming in C++. I'm pretty solid in C and Java though. Anyway, I'm trying to create a class, Mesh, that has a vector full of my other class, Node, however the compiler doesn't seem to like it. I've looked through the console message but I … | |
Hi All, I am trying to learn stl to have some knowledge of how things work. I have just covered some basics and I have come to a block. I will explain what I am trying to do. I have a class that performs some basic operations on its member. … | |
Hi all I want to use GetProcessMemoryInfo to get current memory used by my process..then which PROCESS_MEMORY_COUNTERS (which it takes as argument and return information in it)member is useful.. Please help me... | |
I have problem understanding hashing using linear probing & quadratic probing. Is there any easy to understand guides? | |
Hi! I need help for my homework in c++. My professor wants us to write a program that ask a question and there is a multiple choice and the answer. like the gameshow "Who wants to be a millionaire?" Please give me some example.. (^_^) thank you so much! | |
hello, how can i call function from another function? i declare 3 functions which are move_mid ,move_left and move_right please see this code (it's just my idea and i know i has many syntacs erorr , but my goal is just how a function call some functions) [CODE]move_left() { cout … | |
Desperately need help ! ..... I need to install Player/Stage ( [URL="http://playerstage.sourceforge.net/"]http://playerstage.sourceforge.net/[/URL] ) on Ubuntu 9.10. Found this, [URL="http://curtis-thoughts.blogspot.com/2010/01/install-playerstage-in-ubuntu-910.html"]http://curtis-thoughts.blogspot.com/2010/01/install-playerstage-in-ubuntu-910.html[/URL] ..... but could not get it to work ! Any help is greatly appreciated ! | |
Hello guys, i would like to ask you about c++ language. i have an assignment and i want to do a movement for the hero? i have an assignment and i want to do a movement for the hero which will be controled by the keyboard.i apologise because my english … | |
hi my friends1 i want to compile c++'s code in fedora but when i used this code: g++ Filename.cpp -o filename.exe my code compile successfully and when is used this code: ./filename.exe my program run but when encounter by scanf an i give input in give me "segmentation fault" an … | |
any one have any suggestions why my code won't work? [CODE] #include <iostream> #include <fstream> #include <cmath> using namespace std; int intro(int &num_games); int random(); int main(void) { int seed(0), num_games(0); int point, point2(1); int a(0), b(0), c(0), d(0); cout<<"Lexi Barlow and Alex Puffer craps.cpp"<<endl; intro(num_games); cout<<"\nEnter a random seed … | |
How do i create a console button so i dont have to go into Dev-c++ to open it | |
Hey, im making a code to ask a user to type in a username and password to continue and for the console to say "thanks" and i need help. Heres my "Unsuccessful" Code: [code]#include <iostream> using namespace std; int main(){ int a, b; a = 159876; b = 43812385; int … | |
i have been told to use a do while loop instead of a goto statment, here is a code i made to try the do while loop, [CODE] int main() { int A = 0; cout << "Enter a number from 1 - 5 " ; cin >> A; do … | |
Hello I was always wondering whats the difference between compiling in these different environment Linux and Windows ! and Why can’t we just run the same executable file (compiled in Linux) both on Windows 7 and Ubuntu? also I | |
I'm trying to design an algorithm that will output data from an array in random order but not repeat until every peace of the data has been output. The size of the array is small (about 10). it picks a random prime number smaller than the size of the array(lets … | |
[CODE]#include <iostream> #include <iomanip> #include <string> using namespace std; int main() { double V,I,pf,Ib; unsigned short int choice; int In; cout<<"Please choose power supply type\n"; cin>>choice; switch(choice) { case 1:cout<<"You have chosen a single phase power supply\n"; break; case 2:cout<<"You have chosen a three phase power supply\n"; break; default:cout<<"Invalid Choice … | |
can anybody help me how i can jump proxy server and firewalls to open an orkut in user account.... | |
The highlighted part below is where the function located...Is there any problem with the input? [CODE]#include <iostream> #include <iomanip> using namespace std; // function declaration for price to pay. [COLOR="Red"]float caldiscountprice(float[],int[],float[]); [/COLOR] // function declaration for discounted price. [COLOR="Red"]float calpriceafterdiscount(float[],int[],float[]); [/COLOR]//function declaration for Price after Discount int main() { int … | |
We are developing a C++ project with 10 cpp files and 3 header files.We are declared array structure of 3 integer varibles globaly in header file and using in some files and where arrays are updated ,re-adjusted in some cpp files and use in another files.Project is running fine but … | |
[code] #include <iostream> #include <cmath> using namespace std; int main() { double L, APR, Payment, N, brac1, brac2; cout << "Please enter the loan amount: "; cin >>L; cout << "Please enter the APR: "; cin >>APR; cout << "Please enter the number of payments required: "; cin>>N; brac1 = … | |
I have been trying to figure this out for a little while and I really can't seem to get a good grasp on where I am messing this thing up. I keep getting errors: Error 2 error C2664: 'input_polar' : cannot convert parameter 2 from 'int' to 'double &' Error … | |
Language : C++ I have had a bit of confusion with overloading the script operator. Not really sure on how to incorporate the operator. I am almost finished coding a program assignment except for this problem with the srcipt operator. The script operator info taken directly from assignment instructions is … | |
Hi Guys I am writing a function using boost.regex. It should return false if no brackets are found, true if there is a complete match and an exception is thrown if an odd amount of brackets are found (i.e. only opening bracket but not closing bracket). The problem is it … | |
i am trying to work on an assignment that asks me to prompt the user for a name of one of three employees, then prompt for the work hours of 6 days. each of these will be stored in a separate array. then i am to implement the following rules … | |
Hi, i am doing my mom's c++ for engineering class, and doing a project for her, i noticed something in the extra credit section of her project directions. it says to add graphics to represent what variables the users are entering. in this one, it is about beam deflection, and … | |
Each of the two food stores, A and B, of the same company has a list of products that are available in its stock. We assume that the standard input contains NA records for food store A and NB records for food store B. Each record describes the code of … | |
i am trying to write this program and i have no clue how to do it. Could someone help me please. thank you! a) The program implements insertion sort, merge sort, quick sort, and counting sort as subprograms or classes; b) The program reads input from a data file specified … | |
i need to write a C++ program that reads a sequence of integers and saves it into an array. Your program has to check whether each integer n in the sequence is perfect using a brute force approach. That is, your program should use all possible divisors of n from … |
The End.