565 Posted Topics

Member Avatar for arslan.maqsood1
Re: c++

User you; if (you.provide(sourceCode)){ weMightHelp(you); } else{ cout<<"No source code or tries on this matter found.\n" <<"Please show us what you've done so far.\n"; }

Member Avatar for rubberman
0
147
Member Avatar for Ram J

Here's a small function to get you started. It computes the factorial of a number. You can change it to `long double` if you really need big numbers. Also, `unsigned long long int` is platform dependent, if you have any troubles, swich to another data type. unsigned long long int …

Member Avatar for sanjulovers
0
206
Member Avatar for daino

`std::string` are different from `C-style` strings (null terminated sequences of characters). For your example, use the `.c_str()` function from the `string` class to get the `C-style` string. std::ofstream Myfile(mystring.c_str()); [Click Here](http://www.cplusplus.com/reference/string/string/c_str/) to get more info.

Member Avatar for Moschops
0
491
Member Avatar for Tiger1

Duplicate thread of: [able2know](http://able2know.org/topic/215867-1) Wikipedia might help you on that: [Click Here](http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Algorithm) Learn and understand the ideea behind this methon, than try to apply it on Python.

Member Avatar for Lucaci Andrew
0
165
Member Avatar for tazeen_muzammil

Here's some links to help you figure out a decent solution: [Click Here](http://www.cprogramming.com/tutorial/statickeyword.html) [Click Here](http://www.cplusplus.com/doc/tutorial/classes2/)

Member Avatar for Schol-R-LEA
0
332
Member Avatar for Jacklittle01

Here's an useful link [Click Here](http://lmgtfy.com/?q=python+to+exe+converter) But, leaving the joke aside, you could use the py2exe library: [Click Here](http://www.py2exe.org/)

Member Avatar for vegaseat
0
370
Member Avatar for mahesh113

Indeed, but, defining your vector as a Q class, will interpret all its objects inside of him as being of type Q, thus, when pushing back `a` and `b`, you are pushing back copies of those object, copies which will be interpret as being of `Q` class, and since `a` …

Member Avatar for Lucaci Andrew
0
168
Member Avatar for oosinoots

Depending on your needs: are you using a dedicated software for drawing shapes, or are you trying this in a simple fashion way of dots, or?...

Member Avatar for adam tolstoy
0
157
Member Avatar for Lucaci Andrew

So, I've opened DW's main page this morning, and I see this: ![db0b41c48434763ef1c38c9cde2570b2](/attachments/small/3/db0b41c48434763ef1c38c9cde2570b2.png "align-right") Is this the normal way? Or have I been gone that long...

Member Avatar for ndeniche
0
473
Member Avatar for sirlink99

Whenever you want to you `fstream` as for both input and output operations, you have to explicitly say it when you [open](http://www.cplusplus.com/reference/fstream/fstream/open/) a file. Have a look at a tutorial posted a while on daniweb [Click Here](http://www.daniweb.com/software-development/cpp/threads/6542/fstream-tutorial) So, to be of any service, change this in your code: fstream myFile …

Member Avatar for sirlink99
0
392
Member Avatar for grubby

Do you have to count the punctuation also? Because in your example, you have a comma (`','`) and a dot (`'.'`), which, even though the words may be palindrome regarding the sentence, would point that your sentence is not a palindrome. Also, is it a homework requirement to actually use …

Member Avatar for Lucaci Andrew
0
3K
Member Avatar for siddiquedu

Well, I have something that might help you. This will get the last character of each line, which, by your columns, should be the heighest in that line, and will get it's position from the last line, which presumably defines the "columns". **Note: This applies only if the file is …

Member Avatar for siddiquedu
0
299
Member Avatar for uzziel

You'll be needing an array of integers to store for each student his corresponding number of Research projects. Knowing that each student takes a place in the array, you can parse it first adding the corresponsind number of research projects, and on the way, you can keep in memory the …

Member Avatar for new_developer
0
339
Member Avatar for DanDaMan

As Schol-R-LEA said, I doubt that your problem resides in using <ios> or <iostream> in your includes.

Member Avatar for sanjila007
0
1K
Member Avatar for mr.muin13

You could try using `ifstream` for file input, and `ofstream` for file output. Also, I would suggest using a map for storing(in memory) your users and their respective passwords. Another thing, try using `string`s instead of char array. They are more reliable, and you can do much more with them. …

Member Avatar for mr.muin13
0
264
Member Avatar for chrispitt

Well, searching on google isn't that hard: Function overload: [Click Here](http://www.cplusplus.com/doc/tutorial/functions2/) (middle of the page). Operator overload: [Click Here](http://www.cplusplus.com/doc/tutorial/classes2/)

Member Avatar for tinstaafl
0
185
Member Avatar for Jorox03

Well, if the file is not that big, you could use a buffer (`stringstream`). Here's a small example: #include <fstream> #include <string> #include <sstream> int main(){ std::string filename = "a.txt", line; std::ifstream fin(filename.c_str(), std::ios::in); if (fin.good()){ //check if the file exists and can be read std::stringstream bufer; //buffer to store …

Member Avatar for Jorox03
0
4K
Member Avatar for MasterHacker110

Here's a related thread: [Click Here](http://stackoverflow.com/questions/270455/is-it-possible-to-program-iphone-in-c)

Member Avatar for Schol-R-LEA
0
325
Member Avatar for vadimak

I do want to know though, are you familiar with classes in Python, or you didn't get that far into the subject at your school? Because if you can use classes, this will be easy. Also, a modular/function approach will be required if classes are not available.

Member Avatar for vadimak
0
545
Member Avatar for nouth

This is a head start: [Click Here](http://pentangle.net/python/handbook/node52.html) Also, dig around a bit, you'll find plenty more, or just hit on google python reserved words/python reserved imports. As for the imports, before naming a module, make sure you check the name in the documentation, [Click Here](http://docs.python.org/2/library/index.html), to see if the name …

Member Avatar for chriswelborn
1
631
Member Avatar for siss

This is not how we do things around here. First, you give us your attempt at solving the problem you're dealing with, and than you ask a speciffic question, related to your code and/or problem.

Member Avatar for TrustyTony
0
176
Member Avatar for ngkevi1994

> but a better solution would be to use std::strings instead of char*s and since this is C++, it would be advised to use `std::string` when dealing with strings. `std::string` class offers a lot of string manipulation methods and other handy features. Have a look at them: [Click Here](http://www.cplusplus.com/reference/string/string/)

Member Avatar for Lucaci Andrew
0
393
Member Avatar for cyril71

Here are some troubleshot advices: [Click Here](http://www.tech-faq.com/io-device-error.html) Aditionally, open a command window (start-run-cmd) and type this: C:\>cd D:\ than C:\>d: If you did connect to the hardware type `ls` or `dir` in order to see if the OS recognizes your files: D:\>dir

Member Avatar for Reverend Jim
0
214
Member Avatar for faqie

What is that suppose to mean? By this post you have broken several rules: **1. Do post in full-sentence English 2. Do use clear and relevant titles for new articles 3. Do not write in all uppercase or use "leet", "txt" or "chatroom" speak 4. Do read the forum description …

Member Avatar for Octet
-1
89
Member Avatar for tengmat
Member Avatar for hammy2013

You could use google/your course book for such a question, since its answer is almost trivial. #include <string> bool cmp(string a, string b){ return a == b; } Also, have a look at this: [Click Here](http://www.cplusplus.com/reference/string/string/compare/)

Member Avatar for ddanbe
-1
126
Member Avatar for krystosan

Presumably `_getScript()` returns an object if all went well, or a `none` object otherwise. You could test if your `script` variable is `none`, provided that your `_getScript()` function supports returning `none` values. Was this your question, or did I interpret it wrong?

Member Avatar for krystosan
0
3K
Member Avatar for Necrozze

You could try do delete the actual bullet item from the list: for bullet in bullets: crect = pygame.Rect(bullet[0] - 3, bullet[1] - 3,3*2,3*2) shoot = pygame.draw.circle(screen,(255,255,255),(crect.center),3) if crect.colliderect(Boss): bullets.remove(bullet)

Member Avatar for Lucaci Andrew
0
565
Member Avatar for ManthanB

See if this is of any help to you: [Click Here](http://social.msdn.microsoft.com/Forums/en-US/vscrystalreports/thread/79e1da80-f5c6-42fa-80ca-65a10de5729d/)

Member Avatar for ManthanB
0
224
Member Avatar for terrier_unknown

Here, this should clarify a bit the need of classes in a high level programming language: [Click Here](http://www.c-sharpcorner.com/uploadfile/daniel.clark/basics-of-creating-and-using-classes-in-C-Sharp/)

Member Avatar for ddanbe
0
144
Member Avatar for abelLazm
Member Avatar for Ismatus3

That means that you saved in your python folder (when using the ide) a file which is named tkinter.py or a file which name is the same with some original python file. Try looking into your python folder (i.e. `C:\\Python273` or `C:\\Python3.3`) and find that file, and change its name.

Member Avatar for Ismatus3
0
6K
Member Avatar for tensity

You could use the [stringstream](http://www.cplusplus.com/reference/sstream/stringstream/) class.

Member Avatar for deceptikon
0
158
Member Avatar for teha.sani

> so we can build off of it? We usually don't build off of user code, but we do try to offer solution to existing problems regarding a given code. To complete **<Michael>**'s statement, I shall give you the exact rule from our [**Member rules**](http://www.daniweb.com/community/rules) (which you sign on upon …

Member Avatar for Lucaci Andrew
0
162
Member Avatar for happygeek

> Subject: READ THIS FOR YOUR OWN GOOD... It's just me, or when I see the subjects of my e-mails in this form, I just delete them automatically? But again, > The same is not true of everyone, and if such an email arrives in the inbox of someone with …

Member Avatar for <M/>
2
696
Member Avatar for krystosan

names = deque(['raymond', 'rachel', 'matthew', 'roger', 'judith', 'charlie', 'melissa', 'betty']) Will asign a new list to the variable `names` which than will no longer be pointing to the same memory address that `nmls` does (which it did till than by assigning `names` to `nml` : `names = nmls`), thus making …

Member Avatar for Lardmeister
0
210
Member Avatar for josh.culley.31

Recursively calling the main() function (lines 16 to 21) if the input is incorrect it's not good at all. An easy fix would be this: odom2 = odom1 = 0 while (odom1<=1): odom1 = int(input("Please enter a starting value for the odometer: ")) if odom1 <= 1: print("Odometer reading must …

Member Avatar for woooee
0
6K
Member Avatar for johans22

Have you tried reading the documentation for the logging part? [Click Here](http://docs.python.org/2/library/logging.html)

Member Avatar for johans22
0
153
Member Avatar for oalee

Here you go "oldie": [Click Here](http://www.daniweb.com/home/donate)

Member Avatar for jwenting
0
286
Member Avatar for opawix

If you need to replace the first two letters, you can access them directly: string s = "name"; cout<<s[0]<<endl; cout<<s[1]<<endl; thus s[0] = 'x'; s[1] = 'x';

Member Avatar for Lucaci Andrew
0
142
Member Avatar for tony75

That error means you're on Python 2.7.3 or Python 2.7.2; the thing is that there's a difference between the function `'input()'` and the funtion `raw_input()` (`raw_input()` is prior to Python 3.x). `input()` needs a number to be inserted, otherwise it will throw an error if strings are inserted (which is …

Member Avatar for tony75
0
663
Member Avatar for hashim5003

Try changing long n3 = Math.round(Math.random()*1000); whith long n3 = Math.round(Math.random()*(999 - 100) + 100); You'll need to define a range. One way of doing that is by this: Math.random() * (Max - Min) + Min where `Max` would be the maximum three digit number, and `Min` the lowest three …

Member Avatar for hashim5003
0
7K
Member Avatar for tizzqman

You could use a dictionary, on which you map every character from your alphabet with the key character: def cryptography(text): alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz .,;'\"\\[]{}=-+*\|:<>?" key = "XPMGTDHLYONZBWEARKJUFSCIQVxpmgtdhlyonzbwearkjufsciqv .,;'\"\\[]{}=-+*\|:<>?" crypt, decrypt = {}, {} #dictionaries for crypting and decrypting for i, j in zip(alpha, key): crypt[i], decrypt[j] = j, i #fill …

Member Avatar for Lucaci Andrew
0
182
Member Avatar for ScarWars9

![a0e735898d83f818779c2fab966f5c6e](/attachments/large/3/a0e735898d83f818779c2fab966f5c6e.jpg "a0e735898d83f818779c2fab966f5c6e") I would love one of that...

Member Avatar for cproger
0
296
Member Avatar for tony75

As much as we would like to help you, we must see that you've tried first. Show us the code you have so far. > Spoiler alert: there aren't any numbers which are in both lists.

Member Avatar for tony75
0
275
Member Avatar for RounaqJJW

No: #include<iostream.h> or #include<conio.h> or #include<fstream.h> or #include<string.h> One of the buggs resides on line 21. And also, don't read the file character by character, rather try to read the whole line, and than make moddifications on it. But I won't give any hops to this code, because it's... obsolete!

Member Avatar for Lucaci Andrew
0
508
Member Avatar for kasi123

I prefer iPhones, because I believe them to be more robust than other android-looking phones, but this is debatable. They both have advantages and disadvantages. It actually comes down to the user preferences: if you like a solid, but more restrictive environment, you should choose iOS, if you like a …

Member Avatar for Pygame-pi
0
626
Member Avatar for tony75

I guess this works as well: def cipher(message, shift): return ''.join([chr(ord(i)+shift) if i.isalpha() else i for i in message])

Member Avatar for tony75
0
443
Member Avatar for beginner91

> This error is returned if an incorrect protocol is explicitly requested in the socket call, or if an address of the wrong family is used for a socket, for example, in sendto. What do you think this refers to? And btw, why are you trying to get a new …

Member Avatar for beginner91
0
339
Member Avatar for entropic3105

Write each function, for save, and for save as, than add a button, one for the save, and the other for the save as function, or you can use the `tkinger.filedialog` to aid you in that. Here are some links to help you: [Click Here](http://tkinter.unpythonic.net/wiki/tkFileDialog) [Click Here](http://docs.python.org/3.0/library/tkinter.html) Here are some …

Member Avatar for vegaseat
0
305

The End.