| Forum |
|
|||||||
| Programming The destination for developers - C, C++, Java, Python and the lot |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) | |||
|
Burning Bright
Join Date: May 2006
Location: NIT, Bhopal
Posts: 266
|
Code: Quote:
Quote:
Quote:
__________________
..::Fedora ::.. Freedom + Infinity + Speech Registered Linux User #447318 GNUger was here.... Grrr.... Maah! Blog http://brightedges.blogspot.com/ |
|||
|
|
| Advertisements. Register and be a member of the community to get rid of them. | |
|
Advertisement
|
|
|
|
#2 (permalink) |
|
Alpha Geek
Join Date: May 2006
Location: Bang Bang BANGALORE !!
Posts: 755
|
u forgot to give namespace buddy!!!
this code will compile.. Code:
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
ofstream f;
f.open("1.txt");
f.put(65);
std::cout<<"Inserted";
f.close();
return 1;
}
|
|
|
|
|
#3 (permalink) |
|
1337 |)00|) \m/
Join Date: Nov 2005
Location: Cyber Space
Posts: 472
|
^^^
Yeah.. Absolutely correct... As per the ANSI C++ standards, the headers are not longer considered as files.. They are referred from namespace std.....Hence, inclusion of Code:
using namespace std; Don't forget it.
__________________
My Blog : www.vatsuak.blogspot.com My DA page : www.burningsilver.deviantart.com OK..ok..... Ads are bad.. |
|
|
|
|
#4 (permalink) |
|
I see right through you.
Join Date: Sep 2005
Location: Chennai
Posts: 597
|
Once you've used the namespace, the std:: is not necessary.
__________________
I didn't make the world, I only try to live in it. http://lucentbeing.com -- Sykora -- |
|
|
|
|
#5 (permalink) | |
|
Burning Bright
Join Date: May 2006
Location: NIT, Bhopal
Posts: 266
|
Thanks a million buddies.. I thought it was only for console in/out thats why used std:: before cout.. anyways i successfully compiled my code..
Quote:
__________________
..::Fedora ::.. Freedom + Infinity + Speech Registered Linux User #447318 GNUger was here.... Grrr.... Maah! Blog http://brightedges.blogspot.com/ |
|
|
|
|
|
#6 (permalink) |
|
Burning Bright
Join Date: May 2006
Location: NIT, Bhopal
Posts: 266
|
Friends I will be really grateful if anyone of u can suggest me alternative to common used conio functions like getch(), gotoxy(), kbhit(), _setcursortype() etc.
__________________
..::Fedora ::.. Freedom + Infinity + Speech Registered Linux User #447318 GNUger was here.... Grrr.... Maah! Blog http://brightedges.blogspot.com/ |
|
|
|
|
#8 (permalink) | |
|
In The Zone
Join Date: Oct 2006
Posts: 384
|
Quote:
|
|
|
|
|
|
#9 (permalink) |
|
Debian Rocks!
Join Date: Feb 2007
Location: Coimbattore
Posts: 528
|
Linux
------ Anjuta is a good gui ide for gcc,g++ and more.eclipse also there. but CLI compiling helps learning gcc core isnt it?
__________________
"The day windows users wake up to reality, it will be doomsday for Microsoft."UNIX like OS are more secure.get urself out 4m M$ http://whylinuxisbetter.net http://tinyurl.com/2amjjc http://fsf.org |
|
|
|
|
#10 (permalink) | |
|
C# Be Sharp !
Join Date: Jun 2006
Location: Toronto
Posts: 1,805
|
Quote:
better still i sugget you Program in C# , it's much easier to program in it than C++ n it has a vast library of functons n you will hardly ever need to use ny external library .
__________________
There are 10 types of people in the world: those who understand binary and those who do not. |
|
|
|
|
|
#11 (permalink) | |
|
1337 |)00|) \m/
Join Date: Nov 2005
Location: Cyber Space
Posts: 472
|
Quote:
A side question.... How strong is Python when compared to C++ or C# ?? Give a neutral opinion over it.........
__________________
My Blog : www.vatsuak.blogspot.com My DA page : www.burningsilver.deviantart.com OK..ok..... Ads are bad.. |
|
|
|
|
|
#12 (permalink) | |
|
C# Be Sharp !
Join Date: Jun 2006
Location: Toronto
Posts: 1,805
|
Quote:
whereas C++/C# are for system level application development . although C# is a lot easier and as powerful as c++ . python , Perl , etc r very useful when you wanna do simple tasks n automation like extracting links from web-page , or designing phone-cook kinda software . also C++/C# give much more performance as they r compiled n Python apps r interpreted .
__________________
There are 10 types of people in the world: those who understand binary and those who do not. |
|
|
|
|
|
#13 (permalink) |
|
Burning Bright
Join Date: May 2006
Location: NIT, Bhopal
Posts: 266
|
eh! Friends I should have explained why I need getch() and others..Ok my mistake
Here is my explanation, Take this program for example : Code:
int main()
{
int i=0;
char a[]="Help Me! ",ch;
do
{
ch=getch();
printf("%c",a[i%9]);
i++;
}while(ch!=27); // 27 means ESC
return 0;
}
Help me in writing the same program without getch(). The same is with kbhit() : This function is used a continuous loop iteration until a key is pressed: Code:
while(!kbhit())
{
<code>
}
__________________
..::Fedora ::.. Freedom + Infinity + Speech Registered Linux User #447318 GNUger was here.... Grrr.... Maah! Blog http://brightedges.blogspot.com/ |
|
|
|
|
#14 (permalink) | |
|
I see right through you.
Join Date: Sep 2005
Location: Chennai
Posts: 597
|
Quote:
Python lets you do more, and do it faster. By faster, I don't mean that the program itself is faster, but that it is easier to write a program in python because of the ease of the language. The drawback is of course, that is slower than compiled languages. This is mainly noticeable in number crunching programs and the like. The reason why I (and most other Python programmers) prefer python is that the faster program development time is a huge compromise over the performance hit. There are many things you can do in Python that would break your mind in C/C++. Not that it's not possible, just that it's very hard. Sorry for the off-topic.
__________________
I didn't make the world, I only try to live in it. http://lucentbeing.com -- Sykora -- |
|
|
|
|
|
#15 (permalink) |
|
Burning Bright
Join Date: May 2006
Location: NIT, Bhopal
Posts: 266
|
Friends avoid quarrel between different programming languages here .. plz help me solving my problem.
__________________
..::Fedora ::.. Freedom + Infinity + Speech Registered Linux User #447318 GNUger was here.... Grrr.... Maah! Blog http://brightedges.blogspot.com/ |
|
|
|
|
#16 (permalink) |
|
Burning Bright
Join Date: May 2006
Location: NIT, Bhopal
Posts: 266
|
So this thread is dying, Guys please help me with my problem..
And if anyone can write the same program in Python which I have written in Post no. 13
__________________
..::Fedora ::.. Freedom + Infinity + Speech Registered Linux User #447318 GNUger was here.... Grrr.... Maah! Blog http://brightedges.blogspot.com/ |
|
|
|
|
#17 (permalink) |
|
I see right through you.
Join Date: Sep 2005
Location: Chennai
Posts: 597
|
Code:
>>> s = 'Help me! ' >>> i = 0 >>> while True : ... try : ... c = raw_input() ... except KeyboardInterrupt : ... break ... print s[i % 9], ... i += 1
__________________
I didn't make the world, I only try to live in it. http://lucentbeing.com -- Sykora -- |
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| uTorrent “announce” URL Handling Buffer Overflow | goobimama | Technology News | 14 | 16-02-2007 11:06 PM |
| Handling /dev/dsp in C | desertwind | Open Source | 1 | 04-01-2007 07:32 PM |
| Change File size in MB instead of GB in properties of a File | rachitar | QnA (read only) | 4 | 24-11-2005 09:46 AM |