I am trying to figure out how to get a line of 35 "*" using the setfill command. I can't seem to get it to run without having more than just "*" in the line. I have tried several variations but I can't get it to run. I think I have the simplest code set up that I can with the most straight forward direction to get it done.
Here, "*" is a string, not a character -- so this shouldn't have compiled.
If you want a character, you have to use '*'.
cout << right <<setw(34)<< setfill(“*”)<< "*" << endl;
Those weird “ ” symbols should have also given you an error.
In any case, for a character, it should be '*' (single quotes).
I don't know? Maybe it is the version I am using, 2008. According to the text I was using the double quotes were what I was supposed to be using. It could be a misprint in the electronic book too. That has been known to happen. Probably more because I am greener than an evergreen conifer. Thanks for the input.
Hmmm..., that still doesn't work. I have tried modifying it several ways. Getting this line.
1>LINK : fatal error LNK1168: cannot open C:\Users\Thomas\Documents\Visual Studio 2008\Projects\runcheck\Debug\runcheck.exe for writing
Not sure.
Thanks for the help anyway. I appreciate it. I would try the loop but it is not a command we have learned yet. They want the setfill used.
Assuming you didn't do something to nuke the ACL's on that file this is the error you get when you are trying to compile and your application is still loaded into memory. Open task manager and kill it, if it isn't there and the problem is still occurring then Windows only thinks that the file is locked (you can test this by trying to delete the executable, at the very least it may give you a more helpful error) so rebooting your PC should fix that issue. If the problem STILL persists then temporarily disable your AV suite or add an exception for your working directory, it maybe that the AV thinks your executable is a virus.