48,985 Topics

Member Avatar for
Member Avatar for Jjajangmyeon

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, …

Member Avatar for Jjajangmyeon
0
145
Member Avatar for Jjajangmyeon

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 …

Member Avatar for Jjajangmyeon
0
113
Member Avatar for daniela.valkanova

> *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 …

Member Avatar for Sarkurd
0
5K
Member Avatar for Huy_2
Member Avatar for jalferez1

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 …

Member Avatar for David W
0
1K
Member Avatar for Daneos

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 …

Member Avatar for David W
0
207
Member Avatar for Jjajangmyeon

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 …

Member Avatar for Jjajangmyeon
0
6K
Member Avatar for Abeeha sheikh

Hi everyone, please anyone help me... My program is correctly compiled but not runnig? What would be the problem in my program??

Member Avatar for Ancient Dragon
0
144
Member Avatar for Sh4dowz

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 …

Member Avatar for mudasar44
0
374
Member Avatar for rela

// 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:= …

Member Avatar for rubberman
0
782
Member Avatar for Jjajangmyeon

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 …

Member Avatar for Jjajangmyeon
0
160
Member Avatar for bella.twins.94

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', …

Member Avatar for Lucaci Andrew
0
3K
Member Avatar for Gimper

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 …

Member Avatar for rela
-2
3K
Member Avatar for mixelplik

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]; …

Member Avatar for mixelplik
0
285
Member Avatar for Yogesh_9

#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; }

Member Avatar for mike_2000_17
0
179
Member Avatar for Nikolas9896

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.

Member Avatar for NathanOliver
0
130
Member Avatar for Sarkurd

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> …

Member Avatar for Sarkurd
0
754
Member Avatar for cambalinho

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?

Member Avatar for mike_2000_17
0
324
Member Avatar for yaldoo

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 …

Member Avatar for David W
0
2K
Member Avatar for nathan.pavlovsky

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?

Member Avatar for mike_2000_17
0
1K
Member Avatar for cambalinho

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]( …

Member Avatar for cambalinho
0
1K
Member Avatar for yaldoo

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 …

Member Avatar for David W
0
305
Member Avatar for nathan.pavlovsky

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 …

Member Avatar for NathanOliver
0
1K
Member Avatar for Đăng

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); }

Member Avatar for Ancient Dragon
0
173
Member Avatar for vram

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 …

Member Avatar for vram
0
72
Member Avatar for Ben_7

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

Member Avatar for rubberman
0
237
Member Avatar for cambalinho

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?

Member Avatar for cambalinho
0
144
Member Avatar for zhoudavid

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 …

Member Avatar for mike_2000_17
0
257
Member Avatar for ussra2

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 …

Member Avatar for jwenting
0
9K
Member Avatar for kshahnazari

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 = …

Member Avatar for rubberman
0
168

The End.