|
Thanks very much for your assistance!
AF Pilot
|
|
|
|
|
Hi, I'm new to this forum. I'm taking C++ programming in school and it is very difficult for me. My homework is to create a c++ program that implements functions to display the following data. I dont know whats wrong or how to fix it please help.
I don't even know if I wrote the code properly. Any help is appreciated
#include <iostream>
#include <process.h>
#include "stdafx.h"
using namespace std;
/***************************************************************************/
// FUNTIONS
/***************************************************************************/
void Greeting();
void My_personal_info();
void My_favorite_movie();
void My_favorite_move();
void My_favorite_trip();
void My_favorite_book();
void My_favorite_sports();
void pause();
void clrscr();
//MAIN
int _tmain(int argc, _TCHAR* argv[])
{
// greeting the user
Greeting();
pause();
clrscr();
My_personal_info();
pause();
clrscr();
My_favorite_movie();
pause();
clrscr();
My_favorite_trip();
pause();
clrscr();
My_favorite_book();
pause();
clrscr();
My_favorite_sports();
pause();
clrscr();
return 0;
}
void Greeting()
{
cout << "Welcome to my program!!" << endl;
return;
}
void My_personal_info()
{
cout << "First Name: Jon" << endl;
cout << "Last Name: Berry" << endl;
cout << "Age: 17" << endl;
return;
}
void My_favorite_movie()
{
cout << "Movie Title: " << endl;
cout << "Movie Rating: " << endl;
cout << "Year Released: " << endl;
return;
}
void My_favorite_trip
{
cout << "City and County: " << endl;
cout << "Persons Traveled With: " << endl;
cout << "Year Traveled: " << endl;
return;
}
void My_favorite_book
{
cout << "Book Title: " << endl;
cout << "Book Author: " << endl;
cout << "Book Type: " << endl;
return;
}
void My_favorite_sports
{
cout << "Name of Sports: " << endl;
cout << "To Watch or To Play: " << endl;
return;
}
void pause()
{
char dummy;
cout << endl << "Press Enter to Continue. . ."
cin.get(dummy);
return;
}
void clrscr()
{
system("cls");
return;
}
|
|
|
|
|
Aside from a few syntax errors, and it not really being a C++ program, what's the problem?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Actually, technically, it is a C++ program.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
OverdoS wrote: I don't even know if I wrote the code properly. Any help is appreciated
Did your school fail to supply you with proper learning materials, like books and such? Did your school just give you a computer and an internet connection and tell you to figure out the rest by posting questions on internet forums? What is the name of your school?
led mike
|
|
|
|
|
I have an application with an About Dialog Box. The dialog displays an image, and when you click part of the image, a browser opens that takes you to a website. So far, so good. But what I'm finding is that if I close the browser immediately after it opens, it locks up for a few seconds with a blank, white screen. Eventually the browser closes. If I wait, say, ten seconds or so after the browser opens to close it, it will close immediately with no problems..
Here's my code for opening the browser:
::ShellExecute(NULL, "open", "http://www.lesliesanford.com", NULL, NULL, SW_SHOWNORMAL);
Nothing really special there. Any thoughts or clues?
EDIT: Interesting. I just noticed that this problem occurs when I open IE outside of my application. This seems to be a problem that's independent of my app, i.e. my app's not causing it.
|
|
|
|
|
yeah! it puzzled me first, because the same thing has been done by a dozen times by me, nothing went wrong then.
so please update if you find a solution of that ( even if its nothing to do with your app )
Never Work Hard! - Work Smart!!!
www.indianITforum.com
|
|
|
|
|
Seen this problem many a time. Nothing to do with your Programming skills, apart from, why did you call this Browser App in the first place.
This has to do with different threads having to do many things on a finite computer. Calling a Website is 'Expensive'. It typically involves downloading scripts, which gives you the next script title to download.
These things take time to do, and things to dismantle!
This won't be sorted untill we have:
-1500 GB Drives as Standard
-1500 MB Memory as Standard
-1500 MB/S Network Connections
-At the Same time, Everyody in Microsoft thinks that we are working with 10GB drives and 10GB Memory.and 1GB Connections.
Bram van Kampen
|
|
|
|
|
I'm working with a project with fairly large codebase. so i'm looking for some tools, which can function the following task
- Code profiling
- Code formatting
- Dead code detection
- Clone Detection
Do you know any products which helps to do all of these?, or more than that? i don't mind to purchase it even if it costs up to $15,000/-
Never Work Hard! - Work Smart!!!
www.indianITforum.com
|
|
|
|
|
Renjith Ramachandran wrote: Do you know any products which helps to do all of these?
I don't know if it does all, but Visual Studio comes with a profiler.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Can Visual Studio detect dead code btw? It's something I've wanted to do for some time, as I find old functions sometimes in my code that aren't used anymore, but only when I stumble on them.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
sashoalm wrote: Can Visual Studio detect dead code btw?
Technically, yes. I'm sure there is a more automated, efficient way, but I just put the cursor on some function, then select Source Browser from the Tools menu. In the list, select References or Callers Graph. If I needed to do this more often, I would explore other options.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I do something like that too (I use Visual Assist X and it has a similar feature) or just 'Find in Files' cause it's faster. But it's still only one function at a time, and I already have to suspect it is dead code.
I was thinking maybe the compiler/linker had some verbose mode that could report dead code.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I don't know about VS2008 but VS2005 doesn't seem to be able to. It's kind of funny though. It can detect single vars that are unused, but not entire functions or classes including non-virtual ones.
|
|
|
|
|
visual studio features are not enough for my purpose. anyway thanks for your help.
Never Work Hard! - Work Smart!!!
www.indianITforum.com
|
|
|
|
|
Hi,
I have a question on getting Visual Studio 1008 Standard or the Pro version. I have used and worked in VC++ version 6.0 and have used that to develop various smallish MFC programs that we use in our daily work as engineers. We are migrating to new Autocad programs (version 2009) and some of our existing MFC programs are ARX based programs used in Autocad 2000i & 2004.
I have downloaded the new ObjectARX for 2009 and that requires VS 2005 to compile. This VS version is obviously not available from Microsoft any more and caters obviously for "older" technology. We need to purchase VS 2008 but are unsure if the Standard version will be sufficient or should we purchase the professional version. Your expert opinions will be appreciated.
Geurt Bloem Pr Eng
|
|
|
|
|
Geurt Bloem wrote: We need to purchase VS 2008 but are unsure if the Standard version will be sufficient or should we purchase the professional version.
So have you looked at the side-by-side comparison? Only you will know which one meets your Autocad requirements.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
The biggest differences between Standard and Pro are support for Windows Mobile and Remote Debugging. If you don't need these, standard works just fine. (I'd still be using standard except for periodic Windows Mobile development and helping someone else set up remote debugging [I walked through and verified the steps on the system we sell to make sure it could be done.])
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
Thanks a lot for the help and the link helped me a lot. Going for Standard.
Geurt
|
|
|
|
|
You are most welcome.
-Saurabh
|
|
|
|
|
Hey everybody.
I'm having troubles in resolving (using DNSQuery()) a hostname in a subdomain.
I'll explain.
Lets assume MainDomain and SubDomain.
Now, SubDomain is a subdomain to MainDomain (kinda obvious ).
Well... I'm on a host called "maindomain1" and there is a host called "subdomain1".
When I am using DNSQuery() from "maindomain1" to "subdomain1" I get that "subdomain1" does not exist.
What I actually need to do is to place subdomain1's full name:
"subdomain1.SubDomain.MainDomain.com" and it will work.
BUT, I don't want to place the full name!
"Ping" for instance can resolve only by getting "subdomain1", while nslookup can't...
I want to know how "Ping" know how to resolve that subdomain1 name,
Or in other words, is there a C++ function that receives "subdomain1" and returns "subdomain1.SubDomain.MainDomain.com" ???
Thanks a lot!!!
|
|
|
|
|
Green Fuze wrote: using DNSQuery()
How are you using it? There are several parameters with many options. You did not post your code so we don't know what you are doing. Also what domain are you trying testing with?
led mike
|
|
|
|
|
Right
So, I have the following code:
<br />
std::wstring host(_T("subdomain1.SubDomain.MainDomain.com"));<br />
<br />
DNS_RECORD* pDnsRecords;<br />
DNS_STATUS stat = DnsQuery(host.c_str(),<br />
DNS_TYPE_A,<br />
DNS_QUERY_NO_HOSTS_FILE,<br />
NULL,<br />
&pDnsRecords,<br />
NULL);<br />
The code above, works great.
B-U-T, I practically, I do not want to use the full name of the host, which is:
"subdomain1.SubDomain.MainDomain.com"
Only it's name "subdomain1".
Now, when I perform the operation: "ping subdomain1", "ping" does resolve the correct IP without the full name, that means it is possible for sure.
What I want to know, is that if I get from the user the hostname:
"subdomain1"
how can I find out that it's full name is:
"subdomain1.SubDomain.MainDomain.com"
to use in the DnsQuery() that is written above?
Thanks again!
|
|
|
|
|
Can we show/hide MenuItems at runtime.
Is there any example.
Thanks
destined to win
|
|
|
|