48,985 Topics
|
|
I'm writing a program that stores passwords into a char array then checks for 1 upper, lower, number and allows @ - _ . For some reason it won't read the special chars - unless I include this function, but when I do it only evaluates those in the function, … |
|
When a user enters multiple keystrokes the meny prints multiple times. It should spit out an error and reprint the menu once...what gives? void mainMenu(char entries[], int index[]) { char choice; cout << "Please choose 1, 2, or 3.\n"; cout << "1. Save a new password\n"; cout << "2. Display … |
|
> *no instance of function template*maximum* matches the argument list argument types are: (int,int,int)* #include <iostream> using namespace std; template <class T> T maximum(T value) { T maxValue; if (value >= maxValue) maxValue = value; else value = value; return value; } int main() { int number1 = 1; int … |
|
program 1. create a program that accepts strings and syntactically analyze it whether it belongs to the language defined by the BNF below: BNF: <VD>-><DT><VL>; <DT>->char|float|int|double <VL>-><V>|<V>,<VL> <V>->'any valid variable name' program 2. valid assignment statement BNF: <AS>-><ID>=EXP>; <ID>->a|b|c|d <EXP>-><EXP>+<TERM>|<EXP>-<TERM>|<TERM> <TERM>-><ID>|'('<EXP>')' I NEED HELP. THANKS:)) I'M FINE WITH ENGLISH SPEAKING … |
|
Anyone can help me? I have inventory system which works with item-bags. There are 4 different item-bags. 1 bag have 4 other 8, 12, 16. Now for the NPC shop I need to check if there is a free place in my inventory. Lets say, I have 2 bags. 1 … |
|
It's giving me an error telling me my reference variable hasn't been initialized. What does that mean, what's wrong with my code here? /* ------ FUNCTION: NEW ENTRY ------------------------------------ ----------------------------------------------------------------*/ void newEntry(char entries[], int index[]) { char buffer[256]; char password[8]; bool val = 0; int &length; cout << "\n------ New … |
|
Hi everyone, please anyone help me... My program is correctly compiled but not runnig? What would be the problem in my program?? |
|
Hi,I was wondering if anybody had some good C++ tutorial or Books. I want to learn C++ really badly.I really want to start learnig at and early age. I know Java,VB.net but, I need a more powerful language that can do much more.I'm 13 but, don't get me wrong I'm … |
|
// How can I rewrite this loop to C++ from C // I dont know how to define vectors x, z, and v! // x, z, and v are vectors, and N is the number of vectors x and z (N=2). c:= 10; N:= 2; p:= 3; b:=5; for r:= … |
|
This is just a simple menu and I have no clue why it doesn't work. using namespace std; #include <iostream> #include <iomanip> #include <fstream> // ------ Prototypes --------------------------------------------- void mainMenu(); void newEntry(); void display(); void exit(); // ****** MAIN *************************************************** int main() { mainMenu(); return 0; } /* ------ MAIN … |
|
Assuming that a text file named FIRST.TXT contains some text written into it, write a function named vowelwords(), that reads the file FIRST.TXT and creates a new file named SECOND.TXT, to contain only those words from the file FIRST.TXT which start with a lowercase vowel (i.e., with 'a', 'e', 'i', … |
|
Hello everyone. I recently started using C++ and blah blah blah you know the rest. Using my extremely limited knowledge, I attempted to make a basic 4 function calculator CUI in C++. The code I wrote is as follows. [CODE]#include <iostream> #include <string> #include <sstream> using namespace std; char operator … |
|
I'm trying to read a keyboard entry into a 256 char buffer then extract from just the chars entered (trying to restrict it to just 8 characters) I am fundamentally not understanding how the #$%#$^ing char arrays work: #include <iostream> using namespace std; int main() { char buffer[256]; char pw[8]; … |
|
#include<iostream> #include<stdlib.h> using namespace std; int readInt() { int cc=getc(stdin); for(;cc<'0'||cc>'9';) cc=getc(stdin); int ret=0; for(;cc>='0'&&cc<='9';) { ret=ret*10+cc-'0'; cc=getc(stdin); } return ret; } int main(void) { int p=readInt(); cout<<p<<endl; return 0; } |
|
Could you tell me how I can use the .docx file with Visual Studio 2013 but only with C++ code, and in my application **without** using **MS Word** or another wordprocess. Thanks. I wanna change formatting(bold italy, centre..) and text in .docx-files. |
|
Hi i'm following a book but i don't understand `std::string::size_type` and some other data types specially `typedef` i see programmers use them too much. typedef int grades[5]; grades studenA[5], studentB[5]; and why just not use `int` instead of `size_type` while the result is same. #include <iostream> #include <string> #include <algorithm> … |
|
can i declare functions private in header files? imagine that you use a function declared outside the class and you only want be used only by that class... how can i private that function? |
|
Okay, I was given this problem, its another of those file I/O streams and I was wondering how I can change this code to be more "efficient" and change a lot of things. I'm having trouble on what I should change and what I should keep. Please help me out … |
|
I was just wondering, what is a good rule of thumb for industrial-grade code when deciding whether to use the std::array template vs a built-in array? |
|
i'm trying create a class for getting the child controls from it's parent, but without sucess :( class ChildControls { private: vector<HWND> childcontrols; UINT childcontrolsindex; HWND windowparent; public: ChildControls(const HWND parent) { windowparent=parent; //EnumChildWindows(parent, EnumChildProc, 0); } UINT childcontrolscount() { return childcontrolsindex; } HWND GetHWND(UINT index) { EnumChildWindows( windowparent, [this]( … |
|
Okay, I have another problem that I can't figure out and it has to do with the I/O file stuff. This is the problem: Write a function, CountElement, that receives two arguments: a 2-dimensional char array and the size of the array. This function counts the number of digits, small … |
|
Hello programmers! After covering the basics of STL, I decided to complete the following assignment: `Write a function template palindrome that takes a vector parameter and returns true or false according to whether the vector does or does not read the same forward a backward.` So, for example, a vector … |
|
This is my code. It runs but not thing happen #include <windows.h> #include <iostream> #include <string> using namespace std; void CreateFolder(const LPCWSTR path) { if(!CreateDirectory(path ,NULL)) { return; } } void main() { LPCWSTR x; string s = "E:\\data\\"; x = (LPCWSTR)s.c_str(); CreateFolder(x); } |
|
Hi, I would like to use gtkmm within codeblocks, but I don't know how to install it. I installed both packages, but probably Codeblock has to be said where to find the includes and the libs to link. Could someone tell me which files (or only directories?) has to be … |
|
write a c++ program to find the divisors of a positive integer number 'n'. the program should accept input of the positive integer number from the user |
|
RegisterHotKey is for we use the combined keys and the WM_HOTKEY message. i use these function for use the alt combination... but i need ask: can i re-regist the combination keys? |
|
Once I use an IDE to compile my C++ code, this IDE seems know everything of my code: I could find the most original definition of any element in my code, no matter how deep it is from usage to definition. the IDE seems know: 1.my code logic 2.my code … |
|
I have searched these forums and have seen multiple threads on the Weather Structure C++ program. I don't believe they have been resolved. I am tasked with the following: Write a program that uses a structure to store the following weather data for a particular month: Total Rainfall High Temperature … |
|
this might be a simple question so accept my appolegises , I am creating a 2 dimetional pointers to int and I want to release the memory at the end but I think I'm doing It all wrong and all of the memory isn't being relaesed. int **a; a = … |
The End.