- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 15
- Posts with Upvotes
- 14
- Upvoting Members
- 2
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
electrical engineer
- Interests
- programming C, C++ and Python
87 Posted Topics
Re: Well, in that case it would be nice to post your solution... | |
Re: No problem, just show us what you manage to do so far... | |
Re: If you need to write sort code, I would recommend insertion sort. Read this: [url]http://www.eternallyconfuzzled.com/tuts/sorting.html[/url] | |
Re: You can, for fun, choose sort algorithm, use list of words (strings) and use len() for comparison... [url]http://www.daniweb.com/code/snippet452.html[/url] Then, if you have problems making it work you can post code, so we can see what is wrong ;) | |
Hello guys, I need to find out what is my drive's serial number under win XP. I know that there are one serial number from manufacturer (real hard drive) and serial numbers generated by windows. I know that if disk is partitioned into more partitions that each partition will have … | |
Hello, I'm learning Python. It is my first interpreted language. I have some experience with C and C++. I must admit that it's very hard for me to accept a concept of interpreted language. For example I write code in C++, compile it, link it and I have .exe file … | |
Hello, I'm using PythonWin and I have a problem. i don't know how to run script from Python shell Pythonwin Interactive Window). For example I wrote this code (from tutorial): [code] import sys print 'Begining... now...' for x in sys.argv: print x [/code] and I save it as Script.py in … | |
Hello, I'm playing with win API functions readFile and WriteFile. Is it possible to open file using CreateFile in binary mode just like using fopen standard C function. I tried with function WriteFile to write string to a file but it seems that file is opened in textual mode. What … | |
Hi people, when starting many of us were warn not to use gets() function. We know it's unsafe and it might easily crah program. On many boards there is FAQ in which there are advices not to use gets(). I wonder why such function exist in standard library and why … | |
Re: Interesting, please try to stick to the Standard. It's int main (void), not void main() | |
Re: Please, can you post you results and conclusion? Did you manage to see voltage pattern for 'a'? | |
Hello, I'm writing a simple calculator in C. The main problem is I need to parse string to evaluate for example 1+2*(3-1)/2.5. However writing such parses is a very hard task. This is a trivial thing Python using this code: [code] s = raw_input('Please enter expression:') try: x = eval(s) … | |
Hello to all, I didn't find informations about what is overall limit to store documents in Google/gmail online documents. I have fond only how big files can be in orderd to be able to upload them, but didn't find how many. Is it possible that capacity is shared with Gmail … | |
Hello, is it possible to resize partitions under win XP using Disk management tools, or I need special software for that? I know there are couple of software tools such as Partition Magic. However, I'd like to know if this is possible to be done in Win XP itself. Regards | |
Hi to all, after two months I decided to give Python one more chance. Here is a little code snippet about counting number of words in text file. (Under word I assume any combination of letters and numbers delimited by standard separators " .,\n\t" [code] file = open ( "Test.txt", … | |
Hello people, I wonder if there are free web space that can be used. Basically I need storage (ftp) if possible to place materials and worksheets. For example I participate on sci groups and I do math proof of something and want to show this to others. Do you know … | |
Hello to eveyone, I'm reading one article about CPU utillisation in programmable logic controllers, which are also computer based systems. In article is stated that CPU's time is spent on executing both instructions and no-ops (no ops). I cannot uderstand what this no-ops means? Why they exists? Can anyone explain … | |
Hello people, I wonder why many business machines such as servers and process computer (I work in one power plant) use SCSI disks? I noticed that practically all computers that do a lot of processing use SCSI disks. These computers are rather old (4 years and older). Maybe today, situation … | |
Gereetings everybody, I'm reading this article: [url]http://www.daniweb.com/blogs/entry1911.html[/url] I must admit I cannot understand how this is possible? Is this problem affects only users computers or Google web site. "acts by modifying the infected computers' Hosts file " Where is that hosts file? is it on my computer? If my computer … | |
Hello, do you know where to find drivers in order to use USB flash disk on machines with Win NT 4.0. I have found drivers for win 98 and once I installed them, I was able to use three different USB sticks (different manufacturers). Unfortunately, I wasn't so lucky when … | |
Hello guys, It's been a while since I last time posted in this forum. I have strange problem regarding matrix allocation. I was asked to write code that includes 2D array dynamic allocation. I write two version of matrix allocation. Here is in my opinio relevant part of the code: … | |
Hello, maybe this is not the right forum, but I hope you'll be able to help. How many of you used google groups? I have recently signed in but I'm having problem posting new topics. Every time I post it is written my email address (it's partially mask)- I see … | |
Hello people, I have one interesting problem and need your advices. A few days ago, my friend called me and asked for help. He said he had problem with internet connection. It is old computer 400 Mhz on which win98 is installed and he use dial-up just like me. Problem … | |
Hello guys, I want to buy DVD player for home use (not computer DVD device). I want DVD player to be able to play DVD+RW 8 cm double side disk. I assume most of today's DVD player support this feature but yet, I'm not sure. How to check that if … | |
Hello guys, I have formated hard drive at my neighbour's computer. It's relatively new computer with Pentium 4 processor and intel motherboard. Installing windows Xp passed all right, but there was a problem when trying to install chipset drivers. Since sound card and network card are integrated, autorun option offers … | |
Re: Have a look at this: [code] #include <iostream> #include <fstream> #include <string> #include <vector> #include <sstream> using namespace std; struct Record { int num; string name; int score; Record(int n, string nam, int s):num(n),name(nam), score(s){} }; int main() { vector <Record> v; string tmp, name; int num, score; ifstream infile … | |
Re: Indeed, it's not clear what you want. If you need to make program to perform some kind of matrix calculation, why not using two dimensional array defined something like this: [code] int matrix[10][10]; [/code] This code will create matrix 10 x 10 (10 rows and 10 columns). I can give … ![]() | |
Re: Of course you can. [url]www.google.com[/url] is your friend... | |
Re: [url=http://www.eternallyconfuzzled.com/tuts/sorting.html]This[/url] is definitive guide to major sorting algorithms: | |
Re: You should also look at [url=http://cboard.cprogramming.com/showthread.php?p=592354#post592354]this[/url] ;) | |
Re: [QUOTE=yadavvirendra;254330] what is the difference between &ptarray[i] & ptarray[i] due to that the address location of output 2 & output 3 is changing . [/QUOTE] You defined an array of pointers to int named ptarray. Array's elements are pointers. So ptarray[i] represent array element which is actually address of some … | |
Re: Well, according to this: [url]http://www.cppreference.com/cppio/index.html[/url] cin, cout are defined in iostream. And this will also help ypu understand what is going on. [url]http://www.cplusplus.com/ref/iostream/[/url] I hope it helps! | |
Re: Okay, first when you write header file, you want to make protection from including this file more than once (inclusion guard). This is usually done like this: [code] #ifndef FILE_NAME_H #define FIULE_NAME_H //all code comes here #endif [/code] Your way can cause a lot of problem so please write it … | |
Re: You can define matrix using list: [code] matrix = [[1,2,3],[4,5,6],[7,8,9]] print matrix[0][1] [/code] As for multiplication program and Pascal's triangle, you'll need to show some effort. Matrix is not needed for displaying Pascal's triangle | |
Re: [QUOTE=CurtisBridges;251348][IMG]file:///C:/Documents%20and%20Settings/Curtis%20Bridges/My%20Documents/My%20Pictures/Dinosaurs/scan.gif[/IMG][/QUOTE] This is really a school example of how post shouldn't look like! | |
Re: [code] // Operator overloaded using a member functionComplex Complex Complex::operator+( Complex &other ) { return Complex( re + other.re, im + other.im ); } [/code] I hope this helps... | |
Re: Well, you have defined function get_questions() not to take any arguments, but in lines: [code] while current < len(get_questions(index)): [/code] and [code] print current,". ",get_questions(current) [/code] you're passing argument to it. If you want your function to deal with arguments, you need to define it that way. I would do … | |
Re: Try to modify your save to file function. Here's what I would do: [php] def save_students(filename,students): out_file = open(filename, "w") for x in students.keys(): out_file.write(str(x)+","+str(students[x])+"\n") out_file.close() [/php] Is this is what you want? #Max.... will be also written to a file. | |
Re: If you like more informations, this is another good link: [url]http://en.wikipedia.org/wiki/Big_O_notation[/url] | |
Re: Please add system("pause"); at the end. So it should loook like this: [code] ... exit (0); } system("Pause"); } [/code] | |
Re: How about something like this: [code] #include <iostream> #include <sstream> #include <string> #include <fstream> using namespace std; int main () { int i; string str = "test", str2; ofstream files_array[10]; for (i = 0; i < 10; i++) { stringstream sstr; sstr << str << i; files_array[i].open(sstr.str().c_str()); } return 0; … | |
Re: Yes, using C++ string member functions: find() and replace() will make your solution easy and elegant. It's a littel bit harder in C. I would open one file for reading and one file for writing. I would read original file line by line, perform changes if needed and write line … | |
Hello guys, did you ever heard about hardware card (I think it goes into PCI slot) on which you can sav operating system files so that even If you delete some system files on system partition (where Windows is installed) every time you restart system files that were deleted are … | |
Re: It's not very good example especially for beginners. You need to know that C strings are ordinary arrays of characters that ends with zero character '\0' or just 0. for example if you define c string like: [code] char text[50]; [/code] It means it can store 49 character + zero … | |
Re: Maybe you're trying to do something like this: [code] #include <iostream> #include <map> #include <vector> using namespace std; int main () { map < int, vector<int> > map_cont; vector <int> v1; vector <int> v2; vector <int> v3; int i; for (i = 0; i < 10; i++) { v1.push_back(i); } … ![]() | |
Re: If you want to write array of structures in file you should use loop to store each member. Coinsider this code: [code] #include <string.h> #define LEN 5 typedef struct Test { int x; double y; }Test; int main(void) { Test array[LEN]; Test res[LEN]; FILE* fp; int i; /*Open for writing*/ … | |
Re: Where and how didi you define your MD5String function? | |
Re: By default all variasbles and functions are PRIVATE in class. You shoud use explicitely keyword: public if you want something to be public. If you don not write anything it's private. it would be best to declare operators << and >> as friend functions. | |
Re: What about complex solutions of equation? That is exactly what is happening to you. You entered coefficients so that equation has no real solutions. You need to think about it! | |
Re: [QUOTE=LearninKaz]apparently, a search tree is size balanced if the numbers of the nodes in the left and right subtrees of every node differ by no more than one. and height balanced (AVL balanced) if the heights of the left and right subtrees of every node differ by no more than … |
The End.