- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
B.Tech Computer Engineerig student
Re: You could try the scanf function... [CODE=c++] int h,m; scanf("%d:%d",&h,&m); [/CODE] You can enter the time as xx:xx | |
In the following code, the object is not being written into file in line 30 [ICODE]stfile.write((char*)this,sizeof(item));[/ICODE] When line 26 :[ICODE]stfile.read((char*)&ob,sizeof(item));[/ICODE] is hidden the object is written into the file. Please help!!! [CODE=C++] fstream stfile; class item { int code; char name[25]; int price; int qty; public: int getcode() { return … | |
Re: hey! are you sure you are not lying about your name???:icon_eek: Its a good idea to use a screen name instead of your real name. But I don't think its nice to tell people that the screen name is your real name!!! Anyway, welcome abroad sis!!!:) | |
in the following code, getch() is executed before the file is displayed.! whats wrong? how can i correct this? [CODE='c++'] void ReadFile() { char fname[13],ch; cout<<"Enter filename : "; cin>>fname; strcat(fname,".mth"); temp.open(fname,ios::in|ios::nocreate); if(!temp) { cout<<"File does not exist!!!"; getch(); return; } temp.get(ch); while(!temp.eof()) { cout.put(ch); temp.get(ch); } temp.close(); getch(); } … | |
i posted this problem in C++ forum and people told me its impossible. I'm using a very old version of C++ and most of its features are very similar to C. So i thought maybe you people will understand what the problem is.... In the following code, getch() is executed … | |
Please help me in self documenting the program below. All you have to do is, take a quick glance at the following code to see if you can understand what each part is doing. If you have any difficulty in understanding(at a quick glance that is!), please tell me, so … | |
Re: u can make it faster by incrementing counter by 2 when divisibilty by 2 fails. u can further accelerate, by avoiding checking multiples of numbers already checked.(sieve of Eratosthenes) Read sth about it at [URL="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes"]http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes[/URL] also, [url]http://en.wikipedia.org/wiki/Primality_test[/url] will help. and... personally, i feel checking till n/2 will be more efficient … | |
Please help me in self documenting the program below. All u have to do is, take a quick glance at the following code to see if u can understand wat each part is doing. If u have any difficulty in understanding(at a quick glance that is!), pls tell me so … | |
i made a program to evaluate an expression, "expeval.cpp" [find attached]. i then tried to go further..... i made the program to read characters from the keyboard and write it into a file["file.cpp",find attached]. if an expression is encountered, it is evaluated and the result is displayed after the line … | |
Re: Newton-raphson iterative formula for f(x)=0; is [INDENT]x2=x1-f(x1)/f'(x1);[/INDENT] u have to find the root of (x^3)-a=0; so the formula is x2=x1-((x1^3)-a)/(3x1^2); or[INDENT]x2=(2x1+a/x1^2)/3;[/INDENT] In other words u got ur formula wrong. Now let us do the 100 prob with this formula- assume x=1 after Pass 1 x= 34 Pass2 x=22.695501 Pass3 x=15.195048 … | |
Hi, I'm George from India. I'm doing my last year in school. I love programming. Here for some real programming experience. To learn from all u Big B's here. |