Jump to content
  • Advertisement
Sign in to follow this  
EvilCloneVlad

Problem with strings

This topic is 4131 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Im trying to just create a simple string to practice and i keep getting these errors: 8 c:\docume~1\owner\mydocu~1\progra~1\main.cpp `string' undeclared (first use this function) 8 c:\docume~1\owner\mydocu~1\progra~1\main.cpp parse error before `;'
#include <iostream.h>
#include <stdlib.h>
#include <string.h>
using namespace std;

int main()
{

      string CharacterName;

      CharacterName = "Timmy Boy!";

      cout << CharacterName;

      system("PAUSE");
      return 0;
}

Share this post


Link to post
Share on other sites
Advertisement
#include <iostream>
#include <cstdlib>
#include <string>

The standard c++ headers don't have any extension.

Share this post


Link to post
Share on other sites
ok thanks, im using DEVCPP and it defaulted to including them with the '.h' so i naturally included the .h on the end of the string header without thinking.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!