1,177 Posted Topics

Member Avatar for kuromiyaruka

It looks like you are taking a sorted list and jumbling it? What is the significance of the different rows? You're going to have to show us you've tried before you will get any help. Post your code.

Member Avatar for daviddoria
-1
68
Member Avatar for hdb25

I'm confused. Your title says "string to int to string", so I was looking for StringToInt() and IntToString() functions, but instead found hex and dec and those things. Can you remove all of the unnecessary code and hardcode the input so we can take look at only relevant material?

Member Avatar for flukebob
0
208
Member Avatar for soban

This look very "c style" to me - maybe it should be moved to the C subforum?

Member Avatar for daviddoria
0
88
Member Avatar for Mona..

You mean there is nothing in the output file? It is not supposed to show anything on the screen...

Member Avatar for Mona..
0
256
Member Avatar for aznlitomik3

Please try a little bit before asking for help. I would expect the plusEquals function to take a parameter of type 'fraction' for starters.

Member Avatar for aznlitomik3
0
1K
Member Avatar for mbouster

[QUOTE] I will denote the husbands with the following notations h1 = 11, h2=12, h3=13 and their respective wives with the numbers w1 = 21, w2 = 22, w3 = 23[/QUOTE] Why assign these ints to the people? Why not use something like this: [code] struct Person { public: enum …

Member Avatar for mbouster
0
2K
Member Avatar for Hassan.shah
Member Avatar for sadsdw
Re: GET

Can you use the getline function insetad? [code] string filename; getline(cin, filename); [/code] David

Member Avatar for sadsdw
0
98
Member Avatar for Mr_PoP
Member Avatar for sadsdw

Please use code tags when posting code. Also, please try to simplify your code before showing us. Surely it doesn't take 125 lines to demonstrate this error. I bet you can get it down to 20 :)

Member Avatar for daviddoria
0
199
Member Avatar for daviddoria

This page works fine in Firefox and Chrome: [url]http://ewh.ieee.org/r1/schenectady/events.php[/url] but in IE, the maincontent appears way at the bottom (below the sidebar) instead of to the right of the sidebar as it should. Google convinced me that IE has trouble with CSS, but this is such a basic thing I …

Member Avatar for Arkinder
0
159
Member Avatar for Hey11

Replace [code] player players[11]; [/code] with [code] std::vector<player> players; [/code] Then you can use .push_back() to add items to the end of the vector. If you're looking for random access deletion, you should use a <list> instead of a vector.

Member Avatar for daviddoria
0
223
Member Avatar for chode1

You're on the right track. In the snippet below, the stringstream acts just like your file stream. [code] #include <iostream> #include <string> #include <sstream> int main(int, char *[]) { std::string line = "11/29/2010 S 2907 1"; int myInt; char myChar; std::string myString; std::stringstream ss; ss << line; ss >> myInt …

Member Avatar for daviddoria
0
210
Member Avatar for mpike

Two things (maybe) 1) [icode] std::string squareArray[] = {"0","1","2","3","4","5","6","7","8","9"};[/icode] looks scary. I would use: [icode] std::string squareArray[10] = {"0","1","2","3","4","5","6","7","8","9"};[/icode] 2) It looks like you don't initialize your member variables. Make a constructor and in it initialize iTurn, turns, gameWon, and i. ('i' doesn't seem like a good candidate to be …

Member Avatar for daviddoria
0
123
Member Avatar for hanttaha

Please use code tags when you post code. Please tell us an example input, the expected output, the current output, and any compiler errors. Also, please use English - unfortunately most readers of this forum would have no idea what that code is supposed to be doing. David

Member Avatar for daviddoria
0
113
Member Avatar for Dink3465

A priority queue acts just like a queue but rather than maintain the order that the items were added to the queue, the priority queue sorts the items as they are added. Here is an example: [url]http://programmingexamples.net/index.php?title=CPP/STL/PriorityQueue[/url] As I understand, a heap is the same as a priority queue. Good …

Member Avatar for Dink3465
0
643
Member Avatar for gizmo7008

You are storing the names as int's which doesn't really make sense. I suggest using a [icode]std::vector<std::string>[/icode]. I suggest breaking your problem into two programs for the moment. One which reads your data, and the other which sorts a list of names. 1) For the input, checkout these examples: [url]http://programmingexamples.net/index.php?title=CPP/IO/ReadingLines[/url] …

Member Avatar for gizmo7008
0
115
Member Avatar for narlapavan
Member Avatar for ipcmd0

You need to overload the '<<' operator. There is an example of this here: [url]http://programmingexamples.net/index.php?title=CPP/OverloadOperator[/url]

Member Avatar for daviddoria
0
201
Member Avatar for Hey11

What does this function have to do with linked lists? It looks to me like that simply inputs a string, followed by an int, followed by a char, followed by a double and then displays them. What is it supposed to do?

Member Avatar for daviddoria
0
80
Member Avatar for schoolboy2010

I suggest coming up with a very simple test case. Then you can compare the behavior to the expected behavior and hopefully track down your problem. If you still can't find the problem, you will be able to ask here with much more information of what is going wrong.

Member Avatar for schoolboy2010
-1
268
Member Avatar for tegaelam

Please use code tags when posting code. As far as the compiler is concerned, it is possible that you get to the cout statement [icode]cout << "Average: " << fixed << average << endl;[/icode] without first setting the 'average' variable. That is, you need to either initialize it when you …

Member Avatar for daviddoria
0
110
Member Avatar for daviddoria

I have this: [code] int serialInt = 40000359; [/code] but what I really need is this: [code] int serialHex = (int)0x40000359; [/code] What can I do to turn serialInt into serialHex? I found some code that claimed to do this: [code] int IntToHex(int input) { std::stringstream ss; for (int i=2*sizeof(int) …

Member Avatar for daviddoria
0
177
Member Avatar for Tsunami49

This syntax seems awkward: [code] m2.trans(m2); [/code] If you call the function trans() on an object, it shouldn't take any parameters and it should return void: [code] m2.trans(); [/code] Only if you called the function as a static function would take seem right: [code] m2 = trans(m1); [/code] Also, if …

Member Avatar for Tsunami49
0
108
Member Avatar for burcin erek

Can you explain what you are trying to do a bit more. I ran the program and didn't understand what I was trying to do. Looking at the code, you read 4 colors from the command line, then you try to compare the input colors to the ordered list of …

Member Avatar for mrnutty
0
137
Member Avatar for vbx_wx

I encourage you (or someone else) to put a simple TCPSocket example here: [url]http://programmingexamples.net/index.php?title=CPP/TCPSocket[/url] then we can address your specific problem. You say "every thread to do something else". Does that mean you want different functionalities for specific clients? I'd say there has to be some finite set of client …

Member Avatar for daviddoria
0
106
Member Avatar for KLane

Please use code tags when posting code. What is the problem? Please provide a sample input, the current output, and the expected output. I also suggest decoupling your file input from your algorithm. Hard code some values and make sure the statistics code works first before introducing another challenge of …

Member Avatar for daviddoria
0
102
Member Avatar for sunny120786

You'll probably have much better luck finding a forum dealing with serial communication in C - on a c++ forum I wouldn't expect many answers :(

Member Avatar for daviddoria
0
261
Member Avatar for thestrokes

Please explain the draw condition and errors that you hope to check for in a paragraph form. Then convert this to pseudo code. Then you can write real functions. Also, I would probably store the board as a [icode] std::vector<std::vector< char > > [/icode] so the squares can be accessed …

Member Avatar for daviddoria
0
998
Member Avatar for muze

You may have better luck looking for a Visual Studio forum as this is just a general c++ forum.

Member Avatar for daviddoria
0
78
Member Avatar for ntaraaki

You're going to have to show us that you have tried before you will get any help. What exactly are you struggling with? I'd suggest breaking it down into little pieces. At first, simple, short stand alone programs, which you then convert into function in your actual program.

Member Avatar for geojia
-1
232
Member Avatar for thisischris

When in doubt, you should always remove the user input stuff. There is nothing wrong with your use of the Movie vector (except the name - you should call the vector Movies and the individual movie Movie, not M1 and M2): [code] #include <iostream> #include <string> #include <vector> using namespace …

Member Avatar for thisischris
0
100
Member Avatar for bigman91

I would definitely suggest using a [icode] std::vector<std::string>[/icode] to store the player names. Also, if you hard code an example input that will eliminate one source of errors (the input). It will also let us copy/paste/compile/run your code to help you find the problems. It is much harder when you …

Member Avatar for daviddoria
0
100
Member Avatar for indr

Please use code tags when posting code. The way you are accessing it with [icode] temp->key;[/icode] indeed requires key to be a public member. Nested classes don't get any special privileged (i.e. just because you have defined a class inside of a class doesn't mean it gets access to the …

Member Avatar for indr
0
101
Member Avatar for vavazoom

If you're looking for a basic example of pthreads, this shows how to create a thread: [url]http://programmingexamples.net/index.php?title=CPP/PThreads[/url] If anyone can make that example more informative, that would be great! David

Member Avatar for mike_2000_17
0
281
Member Avatar for liveurlifeteddy

Your structs look fine. I suggest hard coding some inputs so you can show us an example input, the output it produces, and tell us the output you would expect it to produce. David

Member Avatar for liveurlifeteddy
0
112
Member Avatar for yongj

This is the important line: [code] test.c:1:19: error: fstream: No such file or directory [/code] It means your system is not setup correctly. I would try [code] sudo yum install glibc* gcc* libc* [/code] and then see how it goes. David

Member Avatar for daviddoria
0
166
Member Avatar for daviddoria

I have a style: [code] .title1 { color: #0000BB; font-size: 25pt; text-align: center; } [/code] but when I use it with: [code] <span class="title1">Schenectady Section of the IEEE More Words</span> [/code] it doesn't center the text! You can see this behavior here: [url]http://ewh.ieee.org/r1/schenectady/New/[/url] Surely I am just doing something silly... …

Member Avatar for daviddoria
0
148
Member Avatar for Weird Nerd

I think this question is better posed here: [url]http://www.opengl.org/discussion_boards/[/url]

Member Avatar for Weird Nerd
0
514
Member Avatar for daviddoria

I have two pages, header.php and sidebar.php which I want to include on several pages using: [code] <?php include 'header.php'; ?> <?php include 'sidebar.php'; ?> [/code] However, there are two different issues. On this page [url]http://ewh.ieee.org/r1/schenectady/New/index.php[/url] , the included text is put BELOW the text on index.php, even thought it …

Member Avatar for daviddoria
0
89
Member Avatar for daviddoria

Currently at the top of every page I have this: [code] <HTML> <HEAD> <TITLE>Schenectady Section of the IEEE</TITLE> <META NAME='url' CONTENT='http://www.ewh.ieee.org/r1/schenectady/'> <META NAME='author' CONTENT='Authorname'> <META NAME='email' CONTENT='author email'> <META NAME='expires' CONTENT=''> <META NAME='revision-date' CONTENT='6-Sep-1999'> <META NAME='keywords' CONTENT='Schenectady Section'> <META NAME='description' CONTENT='Schenectady Section of the IEEE'> </HEAD> [/code] If I move …

Member Avatar for hielo
0
107
Member Avatar for joe00

You'll have to elaborate. You just want a video? Or you want code to open a 3D data file and produce a video of it rotating? This is definitely a fairly complex task, so you'll have to specify your operating system, which graphics library you want to use (OpenGL, I'd …

Member Avatar for joe00
0
78
Member Avatar for muthu1802

That should show you exactly how it works :) If you don't follow it, break it up into smaller statements: [icode]int m=n=j++ + j++; [/icode] If you have specific questions let us know. David

Member Avatar for Fbody
0
93
Member Avatar for sharifyboy7

It runs fine for me. I just had to change two things where you had 'const' twice: [code] int SortedType::GetLength() const const [/code] to [code] int SortedType::GetLength() const [/code] Can anyone else produce sharifyboy7's problem?

Member Avatar for daviddoria
0
158
Member Avatar for HBK_100

Which if statement? If you could make the smallest compilable example that demonstrates the problem and tell is exactly what is happening and what you would expect to happen, that would be very helpful.

Member Avatar for daviddoria
0
111
Member Avatar for fu1five

It looks fine to me. I removed the user input for easier testing and gave two test cases: [code] #include <iostream> #include <stdexcept> #include <exception> using namespace std; using std::runtime_error; int main(int argc, char* argv[]) { int totalPay = 0; //int hours = 0; // throws exception int hours = …

Member Avatar for daviddoria
0
199
Member Avatar for muze

I don't follow you. You say you run it and it work, but then you say you run it and it crashes?

Member Avatar for muze
0
86
Member Avatar for glenc70

Here is an example: [url]http://programmingexamples.net/index.php?title=CPP/Sockets[/url]

Member Avatar for SgtMe
0
106
Member Avatar for precila

Please use code tags to post code. Also, did you try it? I suggest hard coding the input. Then show us the output and tell us the expected output. David

Member Avatar for geojia
0
194
Member Avatar for eagles39

It looks like you never set grid[row][column] to true in the uncommented portion of the code. Also, can you explain the expected output? Now (maybe related to my last statement), I see nothing output (after commenting the "test first loop" type statements. This leads me to believe that grid[i][j] is …

Member Avatar for eagles39
0
132

The End.