49,761 Topics
| |
To make things easier for cosing in Win32 API, MFC is created which wraps Win32 API in classes. At the beginning i though MFC is there only to aid you making C/C++ GUI Application. For example, CSocket() wraps the function socket(), printf() gets wrapped in another class, and so on. … | |
I need to find out, because my program deals with numbers, how to block characters from being inputted. Such as, [code] int input; cout<<"Please type in a number."<<endl; cin>>input; //input should be a number. A letter? Oh no. [/code] if the input would have been a character, BOOM! Program == … | |
Hi In the below code , i am getting compile time error when declaring the copy constructor . C:\work\Dev-Cpp\bin>"mingw32-c++.exe" dynamicArray.cpp dynamicArray.cpp:13: error: expected `,' or `...' before '&' token dynamicArray.cpp:13: error: ISO C++ forbids declaration of `dynarrray' with no t ype dynamicArray.cpp:13: error: `dynarray::dynarray(int)' and `dynarray::dynarray(in t)' cannot be overloaded … | |
I have a very similar issue. I am also doing and assignment and needed a function grow. This was to increase the size of the object array Savings by s, if it was not NULL, or make its size s if it was null. In both the case it was … | |
Hi All, i have a problem in converting CString to Int/Double, function i am using is _wtoi , _wtof..... Here if the CSting value has say "12345" this works perfectly. But if any other value is say ( Over flow ) " 11111111111111111111111111111" which exceeds the max size of int … | |
Does it need a copy constructor and an operator= for a class which have array member? for example: Class A { private: B data_[100]; //B is a class }; does class A need a copy constructor and an operator? in other words, is the default copy constructor is OK for … | |
I have string and a map<string,int> i need to iterate through the map and find string[i] and replace the int with the string. eg: if map contains hello 6 world 4 its 3 me 60 if the string is "its me hello world world hello" output should be "3 60 … | |
I have a c++ program that performs a functionality. generate.h [code] struct code { bool out; bool *reg; }; class Cyclic { private: struct code *cy; int rgsize; bool *gen; int gensize; unsigned short cycodes[256]; public: Cyclic(int a, int b,bool c[]); void leftShift(); bool* cyclicCode(bool mssg[],int msize); void printReg(); bool* … | |
Hey all, I posted a question earlier this week regarding dev-c++ and my inability to keep the output window (#include <iostream>) open long enough to see my program running! I have already tried the following things and would be grateful for any other suggestions! 1: (Without typing using namespace std;) … | |
Hi Guys I have a query regarding "sizeof" operator and it is related to the program: [B][COLOR="Red"]{ int x; x=sizeof (-32768); printf("%d",X); getch(); }[/COLOR][/B] Then it's printing it's value as [COLOR="Red"]4[/COLOR], But logically it should be[COLOR="Green"] 2[/COLOR] because the integer range is from -32768 to 32767. ============================================== [B]And my second … | |
this is a linked list assigment and the required from me is to fill the functions: i have one fucntion left that i was unable to do which is void DeleteElement(int ID); and i have another problem the compiler states that i hve o errors but when i compile the … | |
Hi viewers, I was trying to delete a file from my hard drive and I don't really have a good place to start. I googled it and came up with a code derived from multiple sources. I was wondering if anyone could help me out with the code to delete … | |
I am trying to read a file from fstream in a switch statement but something in the code seems to be stopping this part of my code to be read by the compiler. Please some one let me know what am I doing wrong. Its not the text file thats … | |
i nees to make a function to output students name in the form last name followed by a comma followed by a space followed by the first name and the name must be left justified than next to it need to print the student score and student grade like this: … | |
[code=c++] 4 char *min(char *a, char *b, char *c){ 5 if(strcmp(a,b) > 0) && (strcmp(a,c) > 0) 6 return a; 7 else if(strcmp(b,a) > 0) && (strcmp(b,c) > 0) 8 return b; 9 else 10 return c; 11 } [/code] Code won't compile and the irony is i just did … | |
Is it possible to call a void function from another void function? will this work? [code] mainMenu() { int input; cout<<"\t\t Main Menu \n\n"; cout<<"\t\t 1. Student Details \n"; cout<<"\t\t 2. Payment Details \n"; cout<<"\t\t 3.Exit \n\n"; cout<<"\t\t Select 1/2/3 : "; cin>>input; if(input==1) { void studentDetails(); } if(input==2) { … | |
I have classes with inheritance (for now only Car, more to add on like Bus, Truck etc) and adding to list. 1) How can i display using the subclass display function? 2) Can list<Vehicle> list be in a class? [code=cpp] #include <iostream> #include <list> using namespace std; class Vehicle { … | |
Here's what I'm trying out: [icode]Substitute characters into values with no set left bits; check if the next position is a vowel(or whatever), turn it into a value with no right bits set, join the two characters into a single byte, delete the unused position now.[/icode] Here's the code using … | |
[code] Apply all steps of conceptual and logical database design on the following requirements: The system should be able to store a customer’s name, address, and contact information and a book’s ISBN, publisher, authors, and title information. A customer should be able to purchase one or many books at a … | |
Hi all. When I create simple console application with Visual Studio C++ ,and I run it, my program shows on full screen, How to adjust my .exe files to show on single console window? | |
so i have been sitting here for about 2 days finishing this thing and i still have one error left and i am having a hard time fixing it 1>k:\c++\energy bill part 3\energy part 2.cpp(119) : error C2059: syntax error : ';' here is my code thanks for your help … | |
Hi all. I was writing my program. And halfway through, i tried to compile and run. but got a blank output. I tried doing a cout<<"hello"<<endl at the main() must still didn't get any display. could anyone please help me to see what went wrong? [code=cplusplus] #include <iostream> #include <fstream> … | |
[code] #include <iostream> #include <cmath> using namespace std; int main () { float leg1, leg2, hyp; cout << "Enter one leg "; cin >> leg1; cout << "Enter one leg "; cin >> leg2; if ((leg1 < 0) || (leg2 < 0)) hyp = 0; else hyp = (sqrt((float)leg1*leg1 + … | |
getting straight to the point, my program compiles fine.. it shows 0 errors and 0 warnings... but when i run my program, it just crashes.. u know the usual dialog box with buttons like send dont send and debug.. .. here's the code.. [CODE] // include the basic windows header … | |
Hi all there. I was given the task to implement a Subset class with a few function. It should be structured so to contain the original set and make it possible to generate all subsets. Right now I'm focusing on the "generate all subsets" part. I've done a little searching … | |
Hello, I have a problem creating a template class with copy ctor and cast operator to class of base template (using gcc 4.2). The program compiles if only one of them is defined but is not compiling if both (copy ctor and cast operator) are defined. The compiler error is … | |
Need some help on text file compression.... Text File Compression. The text file compression must be able to perform the following functions: • Able to compress a text file and generate an index file • Able to decompress the file • Able to show the time taken for compressing and … | |
Hi All, For long now have tried to get Python bindings and none is there. jlgm suggested me to try ctypes and I dived in. But there are few examples on using ctypes for new bees like me. I tried to take lame_enc.dll (The file made me to learn ctypes … | |
This is my example code: [code] #include <vector> std::vector<int> v; int main(int, char **) { std::vector<int>::const_reverse_iterator iter = v.rbegin(); if (iter != v.rbegin()) // or v.rend(), whatever, just problematic { } } [/code] Is this supposed to compile correctly? Using g++ 4.2.4 it does. Using [quote]sbox-i686-linux-gcc (GCC) 3.4.4 (release) (CodeSourcery … |
The End.