51,593 Topics

Member Avatar for
Member Avatar for Jennifer84

When you are writing a whilestatment like this you have ',' as a delimiter. What I wonder is if it is possible to have more than only one delimiter as I also want at the same time use " " and ")". [I](a blank space and a ")" )[/I] Is …

Member Avatar for cbattagler
0
314
Member Avatar for cosmos22

Hello, I have done some research on playing .wav files in C++(As you can only play .wav files) and I've been having some trouble. The coding below works, it just doesn't play the whole song. It plays around 10 seconds of it, then stops. Does anyone have any suggestions? I …

Member Avatar for cbattagler
0
148
Member Avatar for Jennifer84

I am trying to read lines from a .txt file and put them to a vector like this but when I run the program, the computer get stuck. The file is only about 50 lines. I wonder what could be wrong with this code. [code] ifstream File("C:\\Gli\\temp\\File1.txt"); std::vector<string> For; std::string …

Member Avatar for Jennifer84
0
99
Member Avatar for dmsjr12

I'm trying to create a function that uses loops to determine the roots of an equation using the Newton-Raphson method. I have my Newton function set up to take the input from my main prog, calculate the roots, and then return them back into the main prog. Somewhere along the …

Member Avatar for crahhhhhb
0
62
Member Avatar for sunrise2007

hello I have an error with template class and I can not understand what is the problem? the code illustrate the arrangement of many of books by its publishers' names and if the books have same publisher arrange them by the title of the book . [COLOR="Red"]the error is instantiated …

Member Avatar for zhelih
0
144
Member Avatar for USUAggie

Hello all, I am having a bit of a problem with a part of my assignment I hope you can help me out with. I created an abstract baseclass called Geometry and 3 derived classes called Box, Sphere, and Cylinder. I am having a few problems though and I hope …

Member Avatar for vijayan121
0
105
Member Avatar for digitz101

HOW CAN I MAKE A SCORING PROGRAM WHERE IN WHEN A GAME IS PLAYED THERE IS A PART WHERE THE TOP 3 PLAYERS WILL BE DISPLAYED, FOR EXAMPLE WHEN A PROGRAM IS RUNNING 3 PLAYERS WILL PLAY ONE AFTER ANOTHER, SO THE SCORES WILL BE STORED IN AN ARRAY OR …

Member Avatar for Joatmon
0
936
Member Avatar for guest7

Hi, I have a two dimensional vector and I am trying to access all the elements of one row at a time. I am getting a syntax error. Following is my code : std::vector<int> row; std::vector<std::vector<int> > event(5,row); for(lv = 0; lv < 5; lv++) { for(int gno=event[lv].begin; gno != …

Member Avatar for Joatmon
0
215
Member Avatar for digitz101

CAN YOU HELP ME W/ THIS? 1.) I want to create an array to store the total sales for an ice cream store for Monday through Friday. After the array is filled, ask a user to choose a day of the week (Monday = 1, Tuesday = 2, ....) and …

Member Avatar for lAmoebal
0
95
Member Avatar for begyu

Hi, I have generated random unit vector. I would like to rotate it around the axes X,Y,Z in a random way. I thought that I generate 3 random numbers, e.g. 0,1,2. And if the random number is 0, then rotate the vector around X, And if the random number is …

Member Avatar for VernonDozier
0
154
Member Avatar for LanierWexford

I am working on a home work assignment which is: "Write a program that will allow the user to enter an infix expression terminated by '=' your program will convert to Postfix notation" enter 3+7-6/2*8+7= prints 3 7 + 6 2 / 8 * - 7 + I have written …

Member Avatar for chalasesha
0
163
Member Avatar for ithelp

Suppose we have got ten computers in a sub net , each of which is also connected to internet. Each PC has lot of documents , user can also access internet and save web page as a document, Now how can we scan through the sub net to find out …

Member Avatar for vijayan121
0
88
Member Avatar for cosmos22

Hi. I'm trying to write a program that prompts the user of a message at a particular date. For example, a memorable date is set, and the program recognises this date from the code and lists a message. I would like to know how to make something that can capture …

Member Avatar for lAmoebal
0
82
Member Avatar for Jennifer84

. . I have a textBox that contains some lines of text. What I wonder is if this was the textBox that I am writing in now and the 2 . . above these lines will represent completely emty lines. What I am trying to do is to make a …

0
56
Member Avatar for Jennifer84

For the string: "Number(1234)". I am looking for to extract "1234" and "Number" I have understand that I need to know where the positions is for ex "(" and ")". The code I have done so far look like this: [code] std::string Value10 = "Number(1234)"; size_t found1; size_t found2; found1 …

Member Avatar for mitrmkar
0
94
Member Avatar for bornok15

I've been having troubles in getting 2 variables from a function. I've tried to put 2 variables in a function and somewhat code it like in vb put it doesn't save it, even if i declare 2 variable as globals outside of the main. and also my loop statement is …

Member Avatar for bornok15
0
185
Member Avatar for agrawalashishku

I am having a strange problem. Please help me. I have a code which tries to solve the queen's problem. It is wrong so please dont bother yourself with the code unless you are interested. The problem is that when I execute this wrong code, it goes into infinite loop. …

Member Avatar for agrawalashishku
0
97
Member Avatar for risa

I did HANDLE hHeap = GetProcessHeap(); which gives me the handle to the heap of the process then i did DWORD dsize = 468178553; (near pointer)PBYTE pBuffer = (LPBYTE)HeapAlloc(hHeap, 0, size); but here i got pBuffer as NULL and then i did _stprintf( (TCHAR*)pBuffer,"", , ,); here my program crashes.............may …

Member Avatar for risa
0
785
Member Avatar for purepecha

/*Your task is to create the special functions used by this routine, which are shown in blue in the above program. You need to write the functions so that they can be used by the main routine as shown. In other words, do not change the way the functions are …

Member Avatar for ithelp
0
112
Member Avatar for thomascrown

hello guys this is my first post. I was wondering if you guys can help me out validating this peace of my crazy programming. Just taking a class this semester, and i have looked around every where but i cant seem to find a standard it seems like there are …

Member Avatar for Joatmon
0
260
Member Avatar for pship07

I'm new to C++, and my goal is to open a file with numbers in it, and see if they are in order. I also need to check to see if they are strictly increasing, strictly decreasing, or neither. if anybody could help me get started for checking if they …

Member Avatar for Joatmon
0
80
Member Avatar for Exo1337

Write a program that uses while loops and performs the following Prompts the user to input 2 integers firstNum and secondNum // Easy Output all odd numbers between firstNum and secondNum // No idea how to start that. Outputs the sum of all even numbers between firstNum and secondNum Output …

Member Avatar for carnage
0
211
Member Avatar for ramrod

I am a new student of c++ and am having a hard time with a program. i have never used filestreams before and been getting an error from the compiler that i do not understand. it reads ['struct std :: string' has no member named 'c-string'] i dont know if …

Member Avatar for vmanes
0
102
Member Avatar for theNewGuy1992

Hey I am writing a program that will mimike a dice roll. I have the dice based on the value of a random number. the only problem is the random numbers don't change from one run to another, here is the code. #include <cstdlib> #include <iostream> using namespace std; int …

Member Avatar for vijayan121
0
163
Member Avatar for kemarS

Hi, Can anyone explain to me be basic functionality of a filter in MS Visual C++ ? I need to use one to check the database for a file name; if the file name exists in the database, alert the program user that the file has already been uploaded to …

Member Avatar for Duoas
0
88
Member Avatar for havec

I want to disign a class, which can include a reference of a instance. But the class of this instance is not confirm. In java I can use "object" class, because "object" class is father class of all class. for example class XX{ ... ... private object YY; ... public …

Member Avatar for vijayan121
0
93
Member Avatar for Jennifer84

I am using istringstream to put strings separated by commas to own std::strings. I have done this wich works: [code] std::string One, Two, Three, Four, Five, Six; std::string Value = "a,b,c,d,e,f"; istringstream is(Value); while ( getline(is, One, ',') && getline(is, Two, ',') && getline(is, Three, ',') && getline(is, Four, ',') …

Member Avatar for Jennifer84
0
193
Member Avatar for Jennifer84

I have a line in a .txt file that starts with the word "Words". What I am trying to do now is for the example below to find all the words after "Words" that is before a "(" wich in this case is "One" and "Two". As seen they are …

Member Avatar for Lerner
0
920
Member Avatar for Exo1337

#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int num; int guess; int noOfGuesses; bool done; cout << "Ready to Play the Guessing Game?" << endl; cout << "Think you can beat me? You have 5 Guesses!" << endl; num = (rand() + time(0)) % 100; …

Member Avatar for Exo1337
0
109
Member Avatar for Batool110

i am new to dis programming world n programming languages ...so plz help me n tell how i b a gud programmer...my coding is week wat shall i do 2 improve it plz help me:(

Member Avatar for ndeniche
-1
116
Member Avatar for darklich13

I'm having trouble trying to figure out how to create a Cartesian Graph for the formula y=x^2 so that it looks like the following. ------* ---* --* -* * *please disregard the -* Current grid parameters: 20 X 20 array with step 1 I know I have to create a …

Member Avatar for darklich13
0
119
Member Avatar for Lalarukh khalid

Hi everybudy.....:) i have just stepped into dis programing world(c++) n find it very tough coz i had studied computer only upto 8th grade..........im not gud in programing infact a very bad programmer.........although my concepts are almost clear but my implementation mostly goes worng........:'( how can i solve dis problem????????????? …

Member Avatar for lAmoebal
0
156
Member Avatar for hyperzero4

Hello. I'm very new to Compuer Science, and I'm taking a class for fun but I recieved a really hard assignment for homework that I was hoping to get a little bit of help on here and there. It's only compter science for beginners, so I hope it isn't that …

Member Avatar for lAmoebal
0
113
Member Avatar for daviddoria

I am trying to use OPT++ for multidimensional optimization with Visual Studio 2005. I added the include directory to my project. I added the lib directory to my project. When I try to compile the example that ships with the package, i get 102 of the same error: NEWMAT is …

Member Avatar for zhelih
0
170
Member Avatar for Barbarrosa

Hey guys, I've been working on a poker hand recognition assignment and ive been playing around with it for a week getting one problem after the next. Below is my code I have so far. [CODE=cplusplus]#include <cstdlib> #include <iostream> #include <string> #include <fstream> #define iteration_max 10000000 using std::cin; using std::cout; …

Member Avatar for VernonDozier
0
126
Member Avatar for danibootstrap

Hello,I have this C program which is equivalent to the com port.Useful for data logging from the sensors.It consists of the .c file and two header files cport.h and xmodem.h .The code compiles fine but there are lot of linker errors.I tried a lot ,pulled my hair but no use.Can …

Member Avatar for danibootstrap
0
996
Member Avatar for Lutzee

Hai, This is something to save me and osme other people some time. Basically i need to read data from a text file and put that data in a a web form. It will be easy to read the text file but I don't know how to stuff that information …

Member Avatar for Ancient Dragon
0
85
Member Avatar for mrjoli021

I have an array that I need to make into an array of pointers and return the array. [code] string words[i] = { "when", "if", "as if", "in order that", "before", "because", "as soon as", "after", "although", "as long as", "since", "unless", "even though", "so that", "while", "not even" }; …

Member Avatar for Ancient Dragon
0
91
Member Avatar for Cyb3rAssasin

Microsoft has a program called narrator that reads text displayed on the screen. Is there a way I could use this voice? I want to create a program that makes the voice say whatever is typed. So if I type hello then press enter it will say hello. Is there …

Member Avatar for vijayan121
0
89
Member Avatar for Iqbal_h_a

Hi All, I have a doubt regarding "threadsafe". Consider the following scenario.... [inlinecode] Thread #1: fun1() { lock(); writestring(ptr, pconfig); unlock(); } Thread #1: fun2() { lock(); writestring(ptr, pconfig); unlock(); } bool writestring(char *ptr, char *pconfig) { //this code should not be shared across threads. One thread should access at …

Member Avatar for Ancient Dragon
0
96
Member Avatar for daviddoria

Anyone know a good package that will take a multidimensional function and find its minimum? I can't get opt++ to work under windows. My function is not analytic so the package should have numerical gradient stuff built in. I had no idea this would be so hard to find!

0
51
Member Avatar for shadowfire36

i m trying to build a turn based text game but im kinda of confused on the menu's ok here is my issue i want to have 4 menu's in my game menuDisplay selectMenu fightMenu shopMenu now what i want is the menuDisplay to be the welecome menu where the …

Member Avatar for lAmoebal
0
116
Member Avatar for birdy_28

Hi Guys/ girls. I have written a small program for uni, and it involves the user inputting a message that is saved into a string. The only problem is that whenever i use a space within the message the whole program crashes. Can anyone help, i have given the code …

Member Avatar for vijayan121
0
86
Member Avatar for sudhirblgupta

Hi I am trying to display list of codec installed on windows xp through c or c++ program. can any buddy give me idea how I can do it?

0
58
Member Avatar for rathmal

please help me to write algorithms in c++ such as OPT,LRU and FIFO algorithms in memory management

Member Avatar for tarakant_sethy
0
67
Member Avatar for abarnett

Greetings! I am new to the Daniweb community but hopefully you all can help me out with this problem! I am to write a c++ function, smallestIndex that takes as parameters int array & its size and returns the index of the smallest element. then I have to write a …

Member Avatar for highspeedhook
0
3K
Member Avatar for birdy_28

Hi Guys/ girls. I have written a small program for uni, and it involves the user inputting a message that is saved into a string. The only problem is that whenever i use a space within the message the whole program crashes. Can anyone help, i have given the code …

Member Avatar for VernonDozier
0
246
Member Avatar for sauron84

hello, am very new to VC++ programming. I have designed an interface on VC++ using MFC. the visual part is now ready and i need to append my C++ codes to the interface and compile it as a program. I've been trying so far but nothing good came out :s …

Member Avatar for John A
0
90
Member Avatar for taotesea

Open CSV File ,error Code _ConnectionPtr m_adoConn; _RecordsetPtr m_adoRec; ::CoInitialize(NULL); m_adoConn.CreateInstance(__uuidof(Connection)); m_adoConn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\1.csv;Extended Properties=csv;HDR=Yes;FMT=Delimited","","",adModeUnknown); m_adoRec.CreateInstance (__uuidof(Recordset)); m_adoConn->CursorLocation = adUseClient; m_adoRec->Open("select * from c:\\1.csv",m_adoConn.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText); error message: Unknown error 0x800A0E7D thank :)

0
41
Member Avatar for knewc

I am very new to C++, and am struggling with these problems. I must enter in a 10 integer array, and then reverse the array. I do not want to make a function, or use characters, just simple code, this is what I thinking is along the lines of the …

Member Avatar for nezumi4
0
106

The End.