Help! error LNK2019 and fatal error LNK1120

I keep getting error LNK2019 and fatal error LNK1120 for my program.
Any idea what might be wrong? Thanks

#include <iostream>
#include <string>
using namespace std;

void capitalize(string &str)
{
if (str[0] >= 97 && str[0] <= 122)
str[0] = str[0] - 32;

for (size_t i = 1; i < str.length(); i++)
{
if (str[i - 1] == ' '&& str[i] >= 97 && str[i] <= 122)
str[i] = str[i] - 32;
}
}


void insert(string &str)
{
int spaces = 0;

for (size_t i = 1; i < str.length(); i++)
{
if (str[i] == ' ')
spaces++;

if (spaces == 3)
{
str[i] = ':';
spaces = 0;
}
}
}

void replace(string &str)
{
for (size_t i = 1; i < str.length(); i++)
{
if (str[i] == '!' || str[i] == '?')
str[i] = '.';
}
}
Last edited on
Hey. Please put all of your code between code tags - http://www.cplusplus.com/articles/jEywvCM9/

Nothing wrong with your code at all. You got other problems.

http://stackoverflow.com/questions/20870676/c-compile-error-lnk1120-and-lnk2019-with-visual-studio

If that doesnt help, just google the errors, plenty of answers.
you don't have a `main()' function
I thought I wrote that in my post, but I guess not LOL. Yeh, I was gonna ask where main was xD

But. Assuming he wrote that code himself, surely he has to know that you need a main function...
Last edited on
Oh wow I can't believe I made such a stupid mistake! Ok I got it working now, thanks!
Topic archived. No new replies allowed.