| | |
From DevC++ to MVS
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2008
Posts: 37
Reputation:
Solved Threads: 0
I ran into a bug on my program that I couldn't find on my own so I decided to transfer my project from Dev C++ to Microsoft Visual Studio.
In Dev I got away with
But MVS doesn't like doing that. What is the substitute for comparing and saving user inputed strings?
Also:
was what I used to grab the internal clock to create random numbers, but in visual studio, it doesn't recognize that command.
Any help is greatly appreciated
In Dev I got away with
C++ Syntax (Toggle Plain Text)
string sName; cin >> sName;
But MVS doesn't like doing that. What is the substitute for comparing and saving user inputed strings?
Also:
C++ Syntax (Toggle Plain Text)
srand(time(0));
was what I used to grab the internal clock to create random numbers, but in visual studio, it doesn't recognize that command.
Any help is greatly appreciated
•
•
Join Date: Mar 2008
Posts: 1,495
Reputation:
Solved Threads: 123
To use the srand function with time(0) you must include <ctime>. Where as for the first one, I think you have to use a plain char array and then convert that to type string.
It would also help if you showed the errors MSV was giving.
It would also help if you showed the errors MSV was giving.
Last edited by William Hemsworth; Jul 12th, 2008 at 3:43 pm.
I need pageviews! most fun profile ever :)
•
•
Join Date: Jul 2008
Posts: 20
Reputation:
Solved Threads: 0
Maybe the problem is in the include you need to add (#include <string>)
C++ Syntax (Toggle Plain Text)
#include <string> #include <iostream> using namespace std ; int main() { string sName; cin >> sName; return 0; }
Compiler errors? Perhaps post them?
Are proper header files included? And are you
Are proper header files included? And are you
using these from the std namespace ? Last edited by Dave Sinkula; Jul 12th, 2008 at 3:48 pm. Reason: Heh. Pokey.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
•
•
Join Date: Mar 2008
Posts: 1,495
Reputation:
Solved Threads: 123
•
•
•
•
Maybe the problem is in the include you need to add (#include <string>)
C++ Syntax (Toggle Plain Text)
#include <string> #include <iostream> using namespace std ; int main() { string sName; cin >> sName; return 0; }
I need pageviews! most fun profile ever :)
![]() |
Other Threads in the C++ Forum
- Previous Thread: inheritance problem
- Next Thread: libraries recommendation and info needed
Views: 583 | Replies: 6
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char class classes code coding compile compiler console conversion convert count data database delete developer display dll email encryption error file forms fstream function functions game generator getline givemetehcodez graph homeworkhelper iamthwee ifstream image input int java lazy lib loop looping loops map math matrix memory multidimensional multiple newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






