51,593 Topics

Member Avatar for
Member Avatar for lotrsimp12345

it needs to make sure numbers aren't duplicate and are ordered. maybe change my cout statements to arrays? Thanks. This is what program is supposed to do input Q 1,2,3-5,6-7 output do problem 1,2,3,4,5,6,7 of Q. [code] #include <iostream> #include <cstdlib> #include <sstream> #include <string> using namespace std; int main() …

Member Avatar for kvprajapati
0
104
Member Avatar for mexx

I am trying to read a file which contains URLs and are 100 million in number. What I need to do is find out the different websites they are from. So, I am taking chunk of data in memory and reading it line by line. Also, I need to find …

Member Avatar for zdeepblue
0
317
Member Avatar for BretFelix

I have a program and I want to create a function that sorts multiple [B]lines[/B]. The lines are like this: lastName,firstName,gender,studentNumber I want to sort them by LINES, not individual words. Any thoughts? This is for a school project.

Member Avatar for MosaicFuneral
0
2K
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
99
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
119
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
208
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
288
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
171
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
273
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
140
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
125
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
156
Member Avatar for macla
Member Avatar for Salem
0
87
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
105
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
77
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
147
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
173
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
199
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
463
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
229
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
111
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
116
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
81
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
139
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
243
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
190
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
128
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
297
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
122
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
127
Member Avatar for zeus1216gw

I'm using poisson's process for probability. This is the equation I'm using : P(x)= ((lamda^x)*e^(-lamba))/x! it's the factorial part I'm not getting right though. I can get the first 3 probabilities right (0,1,2) but everything after that starts to be off by half and so on. Look I know the …

Member Avatar for zeus1216gw
0
140
Member Avatar for Froboo

Good evening dear programmers, As of Windows Vista, [URL="http://msdn.microsoft.com/en-us/library/bb762181(VS.85).aspx"]SHGetFolderPath[/URL] is deprecated, and replaced by SHGetKnownFolderPath. However, my program must be compatible with both OS versions. I used GetVersionEx to determine the version of the OS that the user uses, but the problem comes later on: [B]main.cpp `SHGetKnownFolderPath' undeclared (first use …

Member Avatar for Ancient Dragon
0
742
Member Avatar for JudithMCA

hello! Im trying to use _popen to execute a cmd app from a WFA using this code.... Im including stdio.h [CODE]_popen("\"d:\\Freeling\\bin\\analyzer.exe -f d:\\Freeling\\share\\config\\es.cfg\"", "r"); [/CODE] This code straight excecuted from the cmd console, works. But the popen inst working not even excecute the cmd console it seem like is going …

Member Avatar for Ancient Dragon
0
146
Member Avatar for u8sand

Hey guys, I was looking at a program that "extended" taskmanager by attaching a dll to the taskmanager's process. I was wondering how this is done and how they were able to add new features and everything. Before you tell me please be aware that I know what a dll …

Member Avatar for u8sand
0
239
Member Avatar for XTRobot

Hi again,first i must say that i am familiar with c++ but only console programming. I am beginner so can you please be more gentle. I want to move on programming with buttons,windows,check boxs,input box and so on,i have heard of API and GUI what is the diference ? They …

Member Avatar for XTRobot
0
282
Member Avatar for lotrsimp12345

so input would be Q1,2,3-5 output would be do problems 1,2,3,4,5 of Q [code] #include <iostream> #include <cstdlib> #include <sstream> #include <string> using namespace std; int main() { cout <<"enter the problemset and number""\n"; //problems represents name and numbers string problems; char quote; char num; string number; //gather name if(cin.peek()=='"' …

Member Avatar for jackcppi2
0
292
Member Avatar for zeus1216gw

I need some help getting this factorial to work. I don't think I'm getting this to work right since only the first 2 work in the series. I probably could write a function to fix this but there has to be a way to loop it instead. This is what …

Member Avatar for tux4life
0
174
Member Avatar for lotrsimp12345

i have created a C string of my variables and guessing i need some king of loop to check each character after it gets it?

Member Avatar for tux4life
0
136
Member Avatar for 9323170

hello every body i need code open/close CD Rom in Borland C++.please tell me.it is very important for me.

Member Avatar for Salem
0
114
Member Avatar for mathueie

Hi, How to get directory size? Recursive alogrithm take more time for calculating directory size. so I don't like search a recursive algorithm. Any other method

Member Avatar for Salem
0
278
Member Avatar for tomtetlaw
Member Avatar for sampsont

Does Eclipse CDT (C++) produce a file that lists the symbols and addresses of the linked program? Thanks!

Member Avatar for Salem
0
60
Member Avatar for lotrsimp12345

so i find the period or whatever the sentence ends in. Then I create a substring from that and delete the part which contains the end character. Then i keep count of it.

Member Avatar for lotrsimp12345
0
130
Member Avatar for ermithun

Hello friends, i am facing issues while finding the reason for a segmentation fault in a CPP-application. Please let me know how to move forward to look for this error, i have a doubt on the following code snippet as this CPP code uses malloc function instead of new. can …

Member Avatar for Hiroshe
0
186
Member Avatar for Raza Najam

I have names of certain students and their ages stored in a text file 'records.txt'. LIKE: John 22 Paul 21 Sam 24 Harry 23 Now i want to store these ages and names in a structure 'records(r)' directly from the file. (Here i am not taking any input from the …

Member Avatar for Hiroshe
0
96
Member Avatar for gretty

I am learnign c++ & I am confused as why or when I would use a struct, class or enumeration In laymans terms how would you describe what a [B]Struct[/B] is, what a [B]Class[/B] is & what a [B]enumeration[/B] is? When I say what are they I mean what are …

Member Avatar for Nick Evan
0
266
Member Avatar for yuenli

Hi, I am trying to connect to sql server by using ADO to insert a record via stored procedure. I keep on encountering this error message (Source: Microsoft OLE DB Provider for SQL Server Description: The precision is invalid.)I had read on several blogs and forums and it said that …

0
50

The End.