Current location: Hot Scripts Forums » Programming Languages » C/C++ » C++ #warning This file includes at least one deprecated or antiquated header. \


C++ #warning This file includes at least one deprecated or antiquated header. \

Reply
  #1 (permalink)  
Old 02-12-10, 10:22 AM
naveed2026 naveed2026 is offline
New Member
 
Join Date: Feb 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
C++ #warning This file includes at least one deprecated or antiquated header. \

Code:
#include<iostream.h>
#include<stdlib.h>
#include<string.h>
class String
{
private :
char string [ 30 ] ;
public :
String ( )
{
       strcpy ( string , "" ) ;
       }
       
void getString ( )
{
cout << "Enter the String : " ;
cin >> string ;
}
void display( )
{
cout << "The String Is : " << string << endl ;
}  // Declaration (prototype) of overloaded sum operator
String operator + ( String & s ) ;
String operator += ( String & s ) ;

void main()
{
     String s1,s2,s3;
     s3=s1+s2;
     s3.display();
     }
};

String String :: operator + ( String &s )
{
String temp; // Declared object temp of String type
strcpy ( temp.string , "" ); // Initialized the temp with empty string
strcat ( temp.string , string ); // Concatenated the driving object's string to //temp object
strcat ( temp.string , s.string ); // Concatenated the argument's string to the
// temp object
return temp; // Returned the temp object
}

String String :: operator += ( String &s )
{
String temp; // Declared object temp of String type
strcpy ( temp.string , "" ); // Initialized the temp with empty string
strcat ( temp.string , string ); // Concatenated the driving object's string to //temp object
temp=temp+s;

return temp; // Returned the temp object
}

Last edited by Nico; 02-12-10 at 12:22 PM. Reason: Wrappers.
Reply With Quote
  #2 (permalink)  
Old 02-12-10, 12:24 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Quote:
use cstdio instead of stdio.h and iostream instead of iostream.h
From: Deprecated Or Antiquated Header - C++
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Hello all, can you help me? K4ot1K Other Languages 2 01-23-09 05:23 AM
Header File Questions newyorkmetz12 C/C++ 1 10-20-07 10:17 AM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM


All times are GMT -5. The time now is 04:40 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.