49,761 Topics

Member Avatar for
Member Avatar for Democles

I am attempting to take names and weights from strings and just simply output them. For some reason it can't get out of the while loop, it just sets there waiting for the users to input names and weights. Here's my code [code=C++] #include <iostream> #include <string> #include <vector> using …

Member Avatar for VernonDozier
0
11K
Member Avatar for Furtano

Hello, i have some decimal numbers and want to put them hexadecimal in a string stream. Every Hex number should consist of 2 chars^^. I can't find a flag for it. [code]0__1__2__3__4__5__6__7__8__9__a__b__c__d__e__f__10__11__12__13__14__15__16__17__18__19__1a__1b__1c__1d__1e__1f__20__21_[/code] should be [code]00__01__02__03__04__05__06__07__08__09__0a__...[/code] [code=c++] #include <cstdio> #include <iostream> #include <sstream> #include <string> #include <iomanip> using namespace std; int …

Member Avatar for daviddoria
0
89
Member Avatar for chria

Hi, I have two classes, Yatzy and YatzyPlayer. In YatzyPlayer.h i create vector<int> mResults and in the constructor in (YatzyPlayer.cpp) i resize it by mResults.resize(15,-2). I also have a function to return this vector declared like vector<int> getResults() and returns mResults. Then in my Yatzy file I'd like to have …

Member Avatar for chria
1
115
Member Avatar for goody11

I was going through a tutorial and had some trouble with an example program. Here's the coding I have and I can't fix it. Here is the main cpp file. [code] #include <windows.h> #include "resource.h" BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) { case WM_INITDIALOG: …

Member Avatar for goody11
0
205
Member Avatar for fatalbert55

Hello All, I am trying to learn C++ on my own, but I think I am having some problems with Code::Blocks. I am familiar with Java (I did some CS as an undergrad) and I feel that the C++ basics are pretty easy to translate from Java; however, I am …

Member Avatar for fatalbert55
0
282
Member Avatar for sfuo

Hi I have been trying for a while to make a win32 app client be able to talk to a server app that I put on my friends computer. I am not 100% sure if the problem is caused by the fact that I have two routers which may interfere …

Member Avatar for sfuo
0
168
Member Avatar for DNDSH

hi all i have a C++ assinment and i can't solve it can anyone help me to solve it is three questions: Q1. Write a C++ program that sends a pointer of an array of characters to function with the function profile void Analyze ( char *abc) . Function Analyze …

Member Avatar for DNDSH
0
254
Member Avatar for GooeyG

I'm just having a hard time understanding the syntax of C++. The book(How to program C++ (fifth edition), by Deitel & Deitel) that my school recommended is impossible for me to understand of what is going on. Can anyone offer any advice or suggestion in making the learning curve of …

Member Avatar for Q8iEnG
0
135
Member Avatar for TrintiyNoe

[CODE]cin<<a;[/CODE] lets say the user enters 'i' if i have a variable i,i want its variable to be displayed or some arbitary "Invalid output" message, any way of doin this,instead of using n case statements in switch???? Is there a way for direct redirection?

Member Avatar for TrintiyNoe
0
123
Member Avatar for TrintiyNoe

can u tell me a way to remove the excess spaces from a sentance using Ws? or anyother way? Lets say i have "This is a sentance" I want "This is a sentance" with ws?

Member Avatar for Tom Gunn
0
152
Member Avatar for macla
Member Avatar for Salem
0
83
Member Avatar for u8sand

Hey guys, I've been programming in consoles/visual C++. But i've been wanting to learn WindowsAPI programming WITHOUT the stupid visual interface for a while now. Could someone provide me some pointers on a good place i can learn this? Right now I'm using [url]http://www.winprog.org/tutorial/start.html[/url]

Member Avatar for u8sand
0
101
Member Avatar for u8sand

I am interested in making my own Hide to Tray program that will hide any program i choose to the tray. I already know how I'm going to do it.. all i need is to know how to hide another window. In Visual C++ you do this->Visible = false; telling …

Member Avatar for u8sand
0
75
Member Avatar for hypernova

I am searching for a book(s) which explains things like the following - 1. Difference between memory allocation of local and global (or other static variables)....? (or why i cant initialize a global variable more than once outside main and all other functions) 2. Holes in structures, and structures and …

Member Avatar for Tom Gunn
0
144
Member Avatar for DezireSoftware

Hello, everybody. I'm not new with C++, or anything, it's just been about a year since I've bothered with Client/Server for MMORPG Making. I am in need of experienced coders to help me out, and teach me, to get me back up there. The engine will be free to use, …

Member Avatar for Sky Diploma
0
169
Member Avatar for Furtano

Call by Reference with String Hello, how can I transfer a String variable with Call by Reference? Here my code: [code=c++] #include <cstdio> #include <iostream> #include <sstream> #include <string> void int_to_hex(int *dez,string hex_string); // Prototype int main(){ string hex_string; //then hex_string becomes a value... int c = 123; int_to_hex(int_to_hex(c, hex_string); …

Member Avatar for Furtano
0
196
Member Avatar for makymakaru

hi.. i'm very new in this programming thing but i need to make this hello world program work in windows and linux environment. thing is i encoded the program below and i used cygwin and andlinux to compile and i still get i think some errors. I'm lost.. really i …

Member Avatar for makymakaru
0
460
Member Avatar for che_che

[code=cplusplus] // File Name: ~ftp/pub/class/cplusplus/Structure/StrucSimple.cpp // Purpose: Demonstrates the use of structure in C++. // Stores some personal data in a structure, then prints // the info out. #include <iostream> using namespace std; int main() { // Defining a structure struct PersonalData { char *FirstName; char *LastName; char *Birthday; // …

Member Avatar for Agni
-2
228
Member Avatar for TrintiyNoe

Hey,i just came by an example where,a string was split off using strings, the input was something like, "342c234" basically, a string where it is full of numbers and in between a char, i used ascii values in a for loop to split them,but somebody just did some sort of …

Member Avatar for TrintiyNoe
0
108
Member Avatar for ermithun

Hello All Can anyone help me to understand the below log line which got generated when segmentation falut occurred, [code=syntax] /data/runtime/myprog/LDAPv3SL/prodlib/libLDAPv3SL_impl.so:std::list<LDAPCtrl,std::allocator<LDAPCtrl> >::iterator std::list<LDAPCtrl,std::allocator<LDAPCtrl> >::erase(std::list<LDAPCtrl,std::allocator<LDAPCtrl> >::iterator,std::list<LDAPCtrl,std::allocator<LDAPCtrl> >::iterator)+0xf4 [ Signal 368 ] /data/runtime/myprog/LDAPv3SL/prodlib/libLDAPv3SL_impl.so:LDAPControlSet::~LDAPControlSet()+0xb0 /data/runtime/myprog/LDAPv3SL/prodlib/libLDAPv3SL_impl.so:LDAPConstraints::~LDAPConstraints #Nvariant 1()+0x6c [/code] i simply dont have any idea on the first few lines of the code, [code] …

Member Avatar for Tom Gunn
0
115
Member Avatar for ermithun

Hello All please help me understand the below code snippet, [code=syntax] LDAPControl** LDAPControlSet::toLDAPControlArray() const{ DEBUG(LDAP_DEBUG_TRACE, "LDAPControlSet::toLDAPControlArray()" << endl); if(data.empty()){ return 0; }else{ LDAPControl** ret= new LDAPControl*[data.size()+1]; CtrlList::const_iterator i; int j=0; for(i=data.begin(); i!=data.end(); i++,j++){ ret[j] = i->getControlStruct(); } ret[data.size()]=0; return ret; } } [/code] please note in the above code, data …

Member Avatar for Sky Diploma
0
78
Member Avatar for Ardvarks

I have been coding a GUI program as a MySQL database manager/utility... The idea of the section I am focusing on is, your enter a guild's name, and it queries the database and displays the guild's info in a textbox. As a test I have used this query: [code]SELECT * …

Member Avatar for Ardvarks
1
136
Member Avatar for lotrsimp12345

here's my code, don't see why it doesn't print out [code] #include <iostream> using namespace std; int main() { cout<<"enter a passage into input to find out how difficult it is to read\n"; string passage; cin>>passage; char letter; int space=0; while(letter!='\n') { if(isspace(cin.peek())&&letter=='\n') { cout<<"from space"; space=space++; } } cout<< …

Member Avatar for Nick Evan
0
238
Member Avatar for dumrat

Hi, Consider the code below: These interfaces are defined in a header. [ICODE] class IA { public: virtual void A() = 0; }; class IB { public: virtual void B() = 0; }; [/ICODE] This concrete class is defined in a library which is later dynamically loaded. [ICODE] class Implementation …

Member Avatar for kvprajapati
0
85
Member Avatar for ermithun

Hello All Can anyone provide me a sample code, executing which generates a segmentation falut. need to understand how it works. Thanks.

Member Avatar for tux4life
0
184
Member Avatar for TrintiyNoe

Hey,can u ppl tell me a simple way of converting a string into a integer? I have something like [ICODE] string str1 ("1000"); string str2 ("2000"); [/ICODE] i wanna convert them into integers and add them,any idea how?

Member Avatar for TrintiyNoe
0
125
Member Avatar for ermithun

Can anyone help me to let me know whats happening in the below code when , [code] data=cs.data;[/code] happens as FYI, data is an empty list created of type std::list and the constructor definition given below is a copy constructor [code=syntax] LDAPControlSet::LDAPControlSet(const LDAPControlSet& cs){ DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPControlSet::LDAPControlSet(&)" << endl); data=cs.data; } [/code] …

Member Avatar for ermithun
0
260
Member Avatar for ermithun

please refer the code below, /** * Constructs an empty std::list */ LDAPControlSet(); only this much is there in its respective class,LDAPControlSet. i want to understand that how does it create an empty list from std when nothing's there in its below constructors?? Moreover, the below constructors are the copy-constructors.. …

Member Avatar for ermithun
0
120
Member Avatar for fourstar

Hi all, I have been working on this code all day and can't seem to really get a grasp on it. Essentially I need to calculate the number of days in the year when the user inputs a month (by name), day, and year My output would look something like …

Member Avatar for fourstar
0
2K
Member Avatar for muhandis

I'm kind of new to Windows programming, especially GUI programming, and have searched for over an hour on how I can easily do this. I don't want any third party software and was wondering if I could just simply change the bitmaps used to display controls. I don't need the …

Member Avatar for Ancient Dragon
0
125

The End.