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
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!