49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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: … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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? | |
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? | |
Hi, How to control disk I/O for partcular application in windows | |
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] | |
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 … | |
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 … | |
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, … | |
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); … | |
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 … | |
[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; // … | |
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 … | |
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] … | |
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 … | |
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 * … | |
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<< … | |
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 … | |
Hello All Can anyone provide me a sample code, executing which generates a segmentation falut. need to understand how it works. Thanks. | |
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? | |
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] … | |
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.. … | |
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 … | |
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 … |
The End.