Hi, What's wrong with this code: [CODE] //Comments explain what I check int Array[9]={1,2,3,4,5,6,7,8,9}; int Integer=0; int i=8,n=0; for(int x=0;x<9;x++) cout<<"array="<<Array[x]<<endl; //Are all members ok? for(int exp=0;i>=0;i--){ Integer+=Array[i]*pow(10,exp); cout<<"Integer1="<<Integer<<endl; //Is Integer being summed fine? exp++; } cout<<"Integer="<<Integer<<endl; [/CODE] Program's function is to create an integer from array ( for example: if array has 1,2,3; it need to make integer 123 ). The problem is terrible: If I have 3-4 members of array my result will decrement during 3rd summing. If I have 5-6 members result will decrement during 3rd and 5th summing. If I have 7 members result will decrement …

Member Avatar
Member Avatar
+0 forum 14

Hi, I'm about to start making some little program with input of type string which'll later be converted into numbers, but it has to pass the check is there any non-digit character. Considering I was lazy to search for functions like that I decided to make my own header for it. So here it is, what do you think: stringcheck.h : [CODE]#include <cstdlib> #include <iostream> using namespace std; int HasChars(string mystring){ int length; length=mystring.length()-1; int cti; (char to int) while(length>=0){ cti=(int)mystring[length]-48; switch(cti){ case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: …

Member Avatar
Member Avatar
+0 forum 5

Hi, I wondered if it was possible to declare the friends of class but out of it? Like this: You have created class: [CODE]class myclass{ int x; public: bla bla bla };[/CODE] And instead of this: [CODE]class myclass{ int x; public: bla bla bla friend class someclass; };[/CODE] If it possible to do something like this: [CODE]class myclass{ int x; public: bla bla bla }; //this is out of class myclass::friend class someclass; [/CODE] I know the last line is piece of crap, but is there any way to do something like that? I need this because I started working …

Member Avatar
Member Avatar
+0 forum 3

Hi, I created the class for converting decimal to binary numbers and I wish to make the Windows application but there's an error: [ICODE]E2285 Could not find a match for 'TForm1::TForm1()' [/ICODE] The source code: [CODE]//--------------------------------------------------------------------------- #include <vcl.h> #include<math.h> #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; class Convert: public TForm1{ static unsigned int i; int conv_number[1000]; unsigned int to_bin(unsigned int); public: void convert(unsigned int); void print_bin(); Convert():TForm1(){}; }; unsigned int Convert::i=0; void Convert::convert(unsigned int number){ while(number!=0) { conv_number[i]=to_bin(number); i++; number=number/2; } } unsigned int Convert::to_bin(unsigned int y) { double z; z=fmod(y,2); if (z==1) return 1; …

Member Avatar
Member Avatar
+0 forum 1

Hi, I wish to start making Windows Applications, but I need a good compiler. Considering I work in DEVC++, I can't make buttons, textboxes and other objects that easy. I wonder if there's any compiler like BorlandBuilder for C, but for C++. That'd really help me :icon_cool: So do you have any compilers like Borland which work with C++? Thanks.

Member Avatar
Member Avatar
+0 forum 3

Hi programmers, I'm Stevan ( online nick: MrEARTHSHAcKER ). I program in C++, currently console only, but I plan to start making Windows Applications. I'm 16 and program since 14, when I started VB 2010, afterwards I learned some C and finally I decided I will be a C++ programmer :icon_cheesygrin: My dream is to create my own game engine one day... :* Greets people!

Member Avatar
Member Avatar
+0 forum 2

The End.