1,177 Posted Topics

Member Avatar for oosb

I don't think you should try to catch this behavior (non integer entered) with a switch. You should look into the "isdigit" function: [url]http://www.cplusplus.com/reference/clibrary/cctype/isdigit/[/url] Another thing to try is [icode]cout << input; [/icode] to see what input actually is.

Member Avatar for daviddoria
0
89
Member Avatar for iCode@Night
Member Avatar for Syrne

Did you take a look through this tutorial? [url]http://www.cplusplus.com/doc/tutorial/classes/[/url] They have great explanations and examples. David

Member Avatar for Syrne
0
250
Member Avatar for kshaaban

That error is pretty clear from a c++ perspective, the type of the paramter you are passing is a vector but the function is expecting a matrix. For more specifics you'd have to ask the OpenCV people.

Member Avatar for wmaiouiru
0
241
Member Avatar for daviddoria

When I get an email notification of a second+ reply to a thread, GMail collapses way too much of the email. [url]http://www.rpi.edu/~doriad/daniweb.jpg[/url] The main thing that is missing is the link to the thread! (Of course I find it if I click "show quoted text". Is this a gmail setting? …

Member Avatar for webstax
0
182
Member Avatar for SoulReaper1680

You are looking for "threads". Boost has a fairly easy to use thread (a simple example: [url]http://programmingexamples.net/index.php?title=CPP/Boost/Threads[/url]) and Qt also has one (QThread). Don't be fooled though, threads get very complex very quickly, so you'll have to do your homework :)

Member Avatar for SoulReaper1680
0
175
Member Avatar for Stefano Mtangoo
Member Avatar for daviddoria
0
85
Member Avatar for cameclifton

I would start not by trying to do the assignment, but by trying to break down the assignment into generic programming problems. "How do I get input from the user?" "How do I make an array?", etc. We can help you with these sorts of things (after you Google for …

Member Avatar for daviddoria
-1
94
Member Avatar for puretnaant

Is the problem with reading them from the file? Or displaying them to the screen? I would separate this problem. 1st program) read the file and inspect its contents in memory 2nd program) hard code values and output them to the screen By doing this you will isolate the problem …

Member Avatar for misfit956
0
171
Member Avatar for jainpratik2

This is not keyboard emulation (which would be GENERATING key presses), but rather just catching key presses, right? Apparently this can be done using curses: [url]http://www.codeguru.com/forum/showthread.php?t=435771[/url]

Member Avatar for jainpratik2
0
768
Member Avatar for Atilly11

I suggest you first write a linked list for ints. This will condense your code into at least a quarter of its current size. Also, remove the file input stuff and hard code some values. Once you have this working, you can "upgrade" your linked list class to support this …

Member Avatar for daviddoria
0
121
Member Avatar for centerline00

Why do you have to name all of the operators? Can't you just push all operators from each string into two stacks and then compare the elements of the stacks? I suggest you hard code two strings, parse them into the two stacks, and then output the contents of the …

Member Avatar for daviddoria
0
218
Member Avatar for aquario20

You look like you're off to a good start. Once you get some more of the details filled in, if you have any specific errors or questions let us know.

Member Avatar for daviddoria
-1
74
Member Avatar for Storchillarn

Looks fine to me. And yes, you would just delete the array at the end of the program.

Member Avatar for daviddoria
0
125
Member Avatar for shubham_shkl

I would ask the OpenCV people if they ever run anything on mobile platforms: [url]http://tech.groups.yahoo.com/group/OpenCV/[/url]

Member Avatar for daviddoria
0
140
Member Avatar for kuchick32

What do you mean "the number of sequences"? Please give an example number and explain what you would expect the result to be. Did you give it a try? You'll get much better replies if you ask a specific question about a problem you're having rather than just asking for …

Member Avatar for frogboy77
0
132
Member Avatar for Vindal

You should definitely separate the user input from the computations. An added benefit of doing this is that you can hard code some values for testing purposes. Also, your function should return something and then you should output the answer from main.

Member Avatar for Vindal
0
2K
Member Avatar for puretnaant
Member Avatar for shamsu50

'worked' does not appear at all in line 28, so I'm assuming you haven't pasted the code the same as it appears in your file?

Member Avatar for mike_2000_17
0
131
Member Avatar for pottart22

Please use code tags when you post code. You cannot re-use the word 'struct' here. [code] struct Data A1[100], A2[100], A3[100]; [/code] It needs to be: [code] Data A1[100], A2[100], A3[100]; [/code] Also, please only post relevant code - that is, the shortest compilable code that produces the error you …

Member Avatar for daviddoria
0
222
Member Avatar for daviddoria

I want to have a template function like this: [code] template <class T> void CreateBlankPatch(typename T::Pointer patch, unsigned int sideLength) { CreateConstantPatch(patch, typename T::PixelType::Zero(), sideLength); } [/code] It works fine as long as Zero() is defined for the class T. However, with POD types, this is clearly not the case. …

Member Avatar for daviddoria
0
169
Member Avatar for Plastix!!

Please pose a question clear enough to be explained and demonstrated in a < 30 line, compilable example. The code should then be posted using code tags.

Member Avatar for ravenous
0
70
Member Avatar for hanttaha

This is quite a complicated function. It is almost impossible to follow - you have multiple nested loops, one letter variable names, and NO comments!! Just because it is called "code" doesn't mean it has to look like an encrypted document! Every one of those nested loops could probably be …

Member Avatar for ravenous
0
3K
Member Avatar for JeremyJ

You can always do a `system()` call to make c++ do it the way you would do it from the command line. In linux, I would use wget: system("wget yourURL"); I'm not sure what you would use in Windows. David

Member Avatar for JeremyJ
0
930
Member Avatar for rocktea

Can you please clarify by giving a small example of the graph and resulting adjacency matrix?

Member Avatar for alwaysLearning0
0
104
Member Avatar for halopower67

Please try to "abstract" your question. This has many benefits (more on this here: [url]http://daviddoria.blogspot.com/2010/05/problem-abstraction-helping-others-help.html[/url] ). For example, instead of: [QUOTE] and im stuck at a part where my program crashes after the ships move for a while [/QUOTE] which has little meaning to anyone not in your class, you …

Member Avatar for daviddoria
0
79
Member Avatar for Eagles36

So basically you are having a problem with file input? Can you post that code (using code tags)? Maybe make a small, compilable demo (< 30 lines) of what is going wrong?

Member Avatar for daviddoria
0
100
Member Avatar for penguins10

I suggest you work through this excellent tutorial: [url]http://www.cplusplus.com/doc/tutorial/[/url] before attempting that assignment.

Member Avatar for Zeeshan Cheema
0
244
Member Avatar for Leppie

There is no difference between "the compiled code" and "the executables created". The code compiles INTO the executables! Can you explain how you are running these "different versions"?

Member Avatar for Leppie
0
149
Member Avatar for MatthewT
Member Avatar for theashman88

You call this: [code] string = zipCode; [/code] before you have defined zipcode. Did you mean to say [code] string zipCode; [/code] ? Also, you can access individual characters in a string with the [] operator. That is, you can check if the first digit is a '6' by doing: …

Member Avatar for dnambembe
0
109
Member Avatar for stemiros

You need to abstract the problem wayyy past "Monsters Inc". You should ask the question generally so it helps the most people. Here are some details and specifics: [url]http://daviddoria.blogspot.com/2010/05/problem-abstraction-helping-others-help.html[/url] Maybe something more like "I have two objects and I want to transform them together" or something like that. You should …

Member Avatar for daviddoria
0
386
Member Avatar for SlzzyDzzy

Haha games are probably not the best place to start. To write a game you have to know some "regular" programming as well as some graphics programming. I would start by going through some OpenGL tutorials. There are some compilable examples here: [url]http://programmingexamples.net/index.php?title=OpenGL[/url] and some great tutorials here: [url]http://nehe.gamedev.net/[/url]

Member Avatar for klemmerj
0
203
Member Avatar for daviddoria

I can see visible wearing on my keys in the phrase "Please use code tags when you post code" (just kidding...). Is there a way to try to auto-detect when this happens and remind the user to do so? In c++ it shouldn't be too hard, look for a few …

Member Avatar for jon.kiparsky
0
430
Member Avatar for AMetnik

Shouldn't this [code] GarbagePointer<int> myGC=new int; [/code] be more like [code] GarbagePointer<int> myGC=new GarbagePointer<int>; [/code]

Member Avatar for daviddoria
0
2K
Member Avatar for roemhildtg

As far as I know you can only 'switch' on int types. CommandCStrngType is definitely not convertible to an int! You should just replace your switch statement with a big if/else if/else.

Member Avatar for daviddoria
0
211
Member Avatar for Lance5057

It doesn't sound like this has anything to do with your game. Maybe you can make a short, compilable example of this lagging effect in a very general context that someone can take a look at.

Member Avatar for daviddoria
0
117
Member Avatar for Jason Giggs

You can use a vector instead of an array [url]http://programmingexamples.net/index.php?title=CPP/STL/Vector[/url] It also has a bunch of cool operations built in (sorting, etc).

Member Avatar for daviddoria
0
68
Member Avatar for glamourhits

Is it: A) [code] group individ; [/code] B) [code] group* individ = new group; [/code] or C) [code] Do_Your_Own_Homework(); [/code]

Member Avatar for daviddoria
0
66
Member Avatar for mkowlowitz

Most of the revision control sites now have built in bug trackers. Github.com for example: [url]https://github.com/blog/411-github-issue-tracker[/url] The big projects I work on use Mantis.

Member Avatar for daviddoria
0
50
Member Avatar for flasp

1) What is the problem? Does the compiler produce errors? Does it not work as you would expect? What is your input, expected output, and current erroneous output? 2) I always suggest separating the computation from the user interaction. Hard code some values and get the algorithm working before you …

Member Avatar for flasp
0
1K
Member Avatar for daviddoria

I am trying to include a file 'header.php' that is in [url]http://ewh.ieee.org/r1/schenectady/[/url] From a file in [url]http://ewh.ieee.org/r1/schenectady/Events/[/url] if I do: [code] <?php include '../header.php';?> [/code] it works fine, as expected. However, if I do: [code] <?php include 'http://ewh.ieee.org/r1/schenectady/header.php';?> [/code] it does not work (the header is not displayed). Can anyone …

Member Avatar for diafol
0
166
Member Avatar for hystaspes

I don't think the conditional on HYS_GLOBAL_VARIABLES is necessary because it is true in exactly the same case that the outer HYS_MAIN_HEADER_H is true. Also, why are you including those windows.h files?

Member Avatar for hystaspes
0
979
Member Avatar for raheel_88

That code doesn't run for me. It crashes on line 58 [icode] v[i][j]=x[i]*y[j]; [/icode] which means either x, y, or v isn't big enough.

Member Avatar for StuXYZ
0
1K
Member Avatar for daviddoria

I have a sidebar.php which contains: [code] <a href="page.html"><src="images/MyImage.gif"></a> [/code] If I do: [code] <?php include 'sidebar.php';?> [/code] from a file that is in '/', everything works properly (because it looks in /images for the gif). However, if I do: [code] <?php include '../sidebar.php';?> [/code] from a file in, say, …

Member Avatar for Arkinder
0
152
Member Avatar for Tiancailee

Is there a reason you're writing your own list class instead of using the one in the STL? [url]http://programmingexamples.net/index.php?title=CPP/STL/List[/url]

Member Avatar for Tiancailee
0
184
Member Avatar for hdb25

As I mentioned in your other thread: [QUOTE] I suggest you make a compilable program no longer than 25 lines that demonstrates the issue. You should also put output statements at every place possible inside 'inttohex' so you can see exactly where it is going wrong. You should also do …

Member Avatar for flukebob
0
353
Member Avatar for localp

Are you sure its supposed to be capitalized? The name of the header is 'mysql', so I would try [icode]mysql *conn;[/icode]

Member Avatar for localp
0
274
Member Avatar for MixedCoder

This is not valid syntax: [code] u_short htons(u_short hostshort); [/code] I think you want simply: [code] u_short htons(hostshort); [/code]

Member Avatar for MixedCoder
0
292
Member Avatar for Martje

What do you mean by "no luck"? Can you show us the error message? My first guess is that I would image Show() takes a string, not a numeric value.

Member Avatar for daviddoria
0
120

The End.