49,757 Topics

Member Avatar for
Member Avatar for lochnessmonster

I was wanting to try a neat little project while i was bored at work and came up with a CodeInjection class. I understand this class is VERY POORLY DESIGNED. My question is how can i fix this?? what can i do differently to make this class not so tightly …

Member Avatar for mike_2000_17
0
102
Member Avatar for FOGMAN

please guys I need help have ramdom numbers and I need to choise the higher number

Member Avatar for Zvjezdan23
-3
105
Member Avatar for AmerJamil

im totally new in object oriented progrmng in C++ course, i have to create a table in which i have to answer in yes /no that for example if class can be public so the answer is Y and if class can not be public then answer will be N. …

Member Avatar for AmerJamil
0
94
Member Avatar for Mahkoe

Why use const char* instead of string? I see it all over the place. Personally, I prefer strings.

Member Avatar for mike_2000_17
0
1K
Member Avatar for packetpirate

I'm having trouble aligning some text with setw and the left alignment. I'm not sure if it has something to do with the fact that I'm printing from a function. The text within quotes aligns fine, but the output from the function aligns to the right and screws up the …

Member Avatar for Ancient Dragon
0
99
Member Avatar for KeerthigaN
Member Avatar for Moschops
-2
38
Member Avatar for VasquezPL

I have found a solution here: [url]http://support.microsoft.com/kb/220600[/url] The problem is that its for MFC..I dunno how to create wrapper for .net C++/CLI I cannot add it via class wizard. using #import produces error: [CODE]Error 1 error C2812: #import is not supported with /clr:pure and /clr:safe[/CODE] I want to use automate …

Member Avatar for VasquezPL
0
443
Member Avatar for dare599z

Hi all! I'm a beginner to C++ and wanted to try my skill at creating a decimal to binary converter in the console. I tried two different methods, but I failed at both. My first program was an attempt at being organized and using multiple functions and snaking the output …

Member Avatar for dare599z
2
275
Member Avatar for lochnessmonster

i really have a hard time creating classes...it seems as if i always run into the trouble of....should this be a function in the class......should it be private or protected......does this really need to be a member variable of the class.....what all should my constructor have inside of it....how can …

Member Avatar for floatingDivs
0
113
Member Avatar for Danny1994

Hai, i have a problems with my ListView in Visual Studio 2008. I can move this delay tab : [url]http://localhostr.com/file/ezujFtB/Unbenannt.png[/url] Like this : [url]http://localhostr.com/file/A91Yo4D/Unbenannt-3.png[/url] How can i prevent that ?, i tryed many differnt settings, but nothing seems to work.

Member Avatar for jonsca
0
125
Member Avatar for Vindal

Hello, I am having some troubles with coding from one of Joyce Farrell's books here is a link showing the exact thing to which I am trying to figure out. [URL="http://books.google.com/books?id=akzWMS9_PYoC&lpg=PA327&dq=BankAccount%20Class%20from%20Joyce%20Farrell&pg=PA331#v=onepage&q&f=false"]Exact question[/URL] Here is the code I have written thus far. [CODE]#include <iostream> #include <iomanip> using namespace std; class BankAccount …

Member Avatar for jonsca
-1
163
Member Avatar for subith86

while i was learning about global variables I did some trials and found one problem. Here goes my code. [CODE]int cows = 10; //global variable void farm1() { int cows; cout<<"in farm1, cows="<<cows<<endl; cows++; } int main() { //cout<<"in main, cows="<<cows<<endl; farm1(); //cout<<"back in main, cows="<<cows<<endl; } [/CODE] Here line …

Member Avatar for mike_2000_17
0
187
Member Avatar for Khoanyneosr

[CODE] #include <iostream> #include <ctime> #include <cstdlib> #include <string> #include <algorithm> using namespace std; //Types and Arrays string word[16] = {"GOLDFISH", "COMPUTER", "ANONYMOUS", "JACKET", "SHARP", "SERVICE", "EFFORT", "CHARACTER", "CHANGE", "WITHOUT", "PRODUCT", "UNFOLDS", "MUSIC", "MOMENT", "LIFETIME", "PROVIDE"}; char guess[50]; static const char Y= 'Y'; static const char N= 'N'; char ans; …

Member Avatar for Khoanyneosr
0
130
Member Avatar for mitrious

I've implemented a version of the String class (named Str) and I was implementing the getline fucntion of the getline function that's what I got [CODE]void* getline(std::istream& is, Str& s){ s.clear(); char c; if(is){ while(is.get(c)) s.push_back(c); return s.begin(); } return NULL; } [/CODE] I used void* so I would be …

Member Avatar for mitrious
0
353
Member Avatar for pandaEater

I'm having some difficulty figuring out how to delete the objects I new'ed during run-time. I'm using a heterogeneous collection. Simplified Example: [CODE] const int SIZE = 4; myBase* objs[SIZE]; objs[0] = new myChild1(); objs[1] = new myChild2(); objs[2] = new myChild3(); objs[3] = new myBase(); //I tried: for(int i …

Member Avatar for pandaEater
0
106
Member Avatar for Rimojenkins

I'm getting a segmentation fault at this line. So far, my program has classes. A blahpod with class of songs in them. Then there is the node class. I call the operator= which is supposed to put one pod into another. It looks like so [CODE]bobcatPod bp2( bp1 );[/CODE] That …

Member Avatar for Rimojenkins
0
158
Member Avatar for LevyDee

[code] std::string headerInfo = " "; //Verify stream is still in good condition if(streamReader->good()) { streamReader->ignore(fileSize, ':'); //work arounds =) v------------v streamReader->getline(&headerInfo[0], sizeof(headerInfo), '\n'); } else { //Error } return headerInfo; [/code] The first parameter of getline wants a char* to store the data, so instead of creating an array …

Member Avatar for LevyDee
0
100
Member Avatar for Tinee

I found this somewhere on some website. Would you care to decode it, like explain why, when, and how they used the codes? The only part I didn't get is how did they get "largest_1" and "largest_2" by doing this. I see that it loops to find it but does …

Member Avatar for Tinee
0
302
Member Avatar for Zvjezdan23
Member Avatar for WaltP
0
182
Member Avatar for sheennave

[CODE] Rectangle ^ClientResolution = gcnew Rectangle(); ClientResolution = Screen::GetBounds(); float CurrentWidth = 1366 ; float CurrentHeight = 768; float RatioWidth = ((float)ClientResolution->Width / (float)CurrentWidth ); float RatioHeight =((float)ClientResolution->Height / (float)CurrentHeight); this->Scale(RatioWidth,RatioHeight); [/CODE] error C2661: 'System::Windows::Forms:: Screen::GetBounds' : no overloaded function takes 0 arguments Any help would be much appreciated.

Member Avatar for sheennave
0
213
Member Avatar for mxrider

I have this problem i had to do for school and im a little confused on what i should put in my first while loop for my program. Thanks for any help pointing me in the right direction! Heres the problem. [url]http://img546.imageshack.us/img546/7454/problemfk.jpg[/url] and heres the code i have so far. …

Member Avatar for ravenous
0
144
Member Avatar for tomtetlaw

Is there any function that allows me to completely remove and [I]deallocate[/I] all contents of a std::map? The functions [icode]clear()[/icode] only removes all elements, it doesn't free any memory.

Member Avatar for Rashakil Fol
0
5K
Member Avatar for CanaznFTW

Currently I'm having an issue with a homework problem although I'm not asking for the answer. I Just want to see if anyone is able to help me trouble shoot my issue... Issue: - ArrayPointer.cpp: In function ‘int* duplicate(int*, int)’: - ArrayPointer.cpp:62: error: expected `;' before ‘list’ - Line 6 …

Member Avatar for floatingDivs
0
131
Member Avatar for mluu510

Hi, I am trying to write a small program that would permute a list of binary numbers to the nth bits. Some reason, the code is not compiling. Also, I am using Visual Studio C++ 2010 Express. When i attempt to compile a code, it doesn't highlight where the errors …

Member Avatar for mrnutty
0
142
Member Avatar for anu07

I am using borland compiler 3.0,is there any way such that the output window will close on its own after the required functions has been completed by the program?

Member Avatar for WaltP
0
46
Member Avatar for imhiya

[CODE]class Node { public: string name; list<string> edges; };[/CODE] [CODE]list<Node> nodes;[/CODE] Hello, Can you help. I used this class that you gave but i've struggling to add anything. I tried nodes.name.push_back(str); but no use, and also i tried nodes::name.push_back(str); i also tried to compare sections by trying nodes[i].name == temp; …

Member Avatar for mrnutty
0
147
Member Avatar for ntrncx

what is wrong with my code? in inputs like "radar" or "tttt" should say its palindrome. [CODE]#include <iostream> using namespace std; bool testpalindrome(string,int,int); int main() { string wordX; bool result; cout<<"Enter string: "; getline(cin,wordX); result=testpalindrome(wordX,wordX.length()-1,0); result==true ? cout<<"\nthe string is palindrome!" : cout<<"\nthe string is NOT palindrome!\n"; } bool testpalindrome(string …

Member Avatar for ntrncx
0
346
Member Avatar for boot-baby-boot

I want to write a simple c++ program that allows me to edit my database tables.Each table stands on its own(no table is related to another).The UI i want is simple.I want my tables to be shown as follows: [LIST=1] [*]Table-One [*]Table-Two [*]Table-Three [*]Table-Four [*]Table-Five [*]Table-Six [*]Table-Seven [*]Table-Eight [*]And-So-Forth [/LIST] …

Member Avatar for Ancient Dragon
0
435
Member Avatar for yapkm01

Newbie to C++ but i am a Java programmer. Trying to learn C++ now. Reading the C++ Primer by Stanley Lipmann. I don't understand this sentence in Chapter 3 about library types. He's talking about library type string and vector. "These library types are abstractions of more primitive types - …

0
83
Member Avatar for MixedCoder

[code]#include <iostream> #include <WinSock2.h> #include <mysql.h> #include <string> #include <vector> #include "action.h" using namespace std; MYSQL *con; st_mysql_res* res = NULL; MYSQL_FIELD * field[200]; MYSQL_ROW myRow; CAction * m_pActionList[1000]; int LoadActions(); int main() { con = mysql_init(con); if(!mysql_real_connect(con,"127.0.0.1","test","test","account_zf",NULL,NULL,NULL)) { cout<<"Error connected"<<endl; system("pause"); exit(-1); return false; } LoadActions(); system("pause"); return 0; …

Member Avatar for MixedCoder
0
249

The End.