Is system part of the standard namespace? std::system()?
Salem commented: Except using void main in a free-standing environment is fine +12
Is system part of the standard namespace? std::system()?
should be the other way around.
You won't read in a sentence with "cin>>". Use
#include <string>
//...
string str;
getline( cin, str);
Plus the a you used is an integer...
>> struct letteroccurance
>> {
>> char letters[];
>> int occurance[];
>> };
That won't do. Just make the counter 26 elements wide... You don't need the letters. Well not for counting. Consider this:
string str = "testing";
int let_count[26] = {0};
for ( size_t i=0; i<str.size(); i++ )
let_count[str[i]-'a']++;
>> char main()
Interesting... Guess it's not as bad as void...
No. I just thought it was an amusing quote ... The Book Thief.
Probably posted before: The difference between insanity and genius is success.
Is that a true story... Link anywhere... cause that's a pretty stupid thing to say.
Oh... it was Quentin Crisp who said that... stupid Irish people.
Only one thing worse than a boy who hates you -- a boy who loves you.
Awww.
Burn for cheap heating? I haven't been programming that long and only have... well no books...
Generic presents to people you don't like.
http://www.news.com/8301-10784_3-9840073-7.html?tag=nefd.lede She makes a good point (I've only r4ead the title). I really haven't been following the American election at all. What are they all planning? "Abortions for some, miniature American flags for others?"
My brother was doing some conference thing in ... Vegas I think, and in the preparation for it he was told not to be offended if people fell asleep in it as many will have traveled long distances. I thought he was kidding first, but then he assured me he was serious... heh.
Persistently arrogant people who don't listen to sense.
Many hundreds if not thousands, probably.
What did Microsoft say about 'small time' MS Prirateers?
void foo( int val ) {
val = 1;
}
void foo2( int &ref ) {
ref = 1;
}
First is by value, second is by reference. You can change the value of 'ref' in foo2 by setting its value and the value will change outside the scope of the function, but in foo the value only changes within foo's scope. Not outside ...
// with regard to the above two functions
int main( void ) {
int num = 2;
foo( num ); std::cout << num << "\n";
foo2(num ); std::cout<< num << "\n";
return 0;
}
The output should be
2
1
You should post some code to show us that you've tried something. Generally we're a lot more helpful if we see some effort...
>> Citation needed
Yeah? I'll cite your ation.
Simply put leet-speek :) I generally use something I can remember and bastardise and leet it up... Upper and lower characters, numbers, symbols, punctuation. I generally have a minimum of 10 characters too.
They're afraid of the justified retribution they'd receive.
In the Latin-speaking Christianity of medieval Western Europe (and so among Catholics and many Protestants today), the most common Christogram is "IHS" or "IHC", derived from the first three letters of the Greek name of Jesus, iota-eta-sigma or ΙΗΣ.
Jesus H. Christ is an example of slang serving as a mild profanity.
Wiki don't lie...
Use std::stringstream
or using namespace std;
Stringstreams are part of the std
namespace. Dragon just forgot to insert it (old age, you know ;))
People who leave doors open when they creak... also people who eat noisly for some reason.
Well, this is heavily dependant on your OS and compiler.. this works in XP and MSVC .NET 03:
#include <windows.h>
#include <Iphlpapi.h>
#pragma comment ( lib, "Iphlpapi.lib" )
static void GetMACaddress(void)
{
IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information
// for up to 16 NICs
DWORD dwBufLen = sizeof(AdapterInfo); // Save memory size of buffer
DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo
AdapterInfo, // [out] buffer to receive data
&dwBufLen); // [in] size of receive data buffer
if(dwStatus == ERROR_SUCCESS) { // Verify return value is
// valid, no buffer overflow
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to
// current adapter info
do {
std::cout<< &pAdapterInfo->Address; // Print MAC address
pAdapterInfo = pAdapterInfo->Next; // Progress through
// linked list
}
while(pAdapterInfo); // Terminate if last adapter
}
}
int main( void ) {
GetMACaddress();
return 0;
}
Don't know if it's what you want. Searching always helps. http://www.codeguru.com/Cpp/I-N/network/networkinformation/article.php/c5451
I'd like to buy a smallish island. Seriously.
>> So is there any way I can get rid of the initial argument?
You could just make it a friend function ...
template< typename mis_type >
class missle_man {
protected:
std::vector<mis_type> vms;
public:
template< typename mis_a,
typename mis_b >
friend bool is_coll( const mis_a &missle_a,
const mis_b &missle_b );
// Friend so it can access private members
};
template< typename mis_a,
typename mis_b >
bool is_coll( const mis_a &missle_a,
const mis_b &missle_b ) {
return missle_a.vms.size() != missle_b.vms.size();
}
int main( void ) {
missle_man<int> cai;
missle_man<double> cad;
std::cout<< is_coll(cai, cad);
return 0;
}
I know this kind of breaks the OO scheme of your code... but it sure does make it 'look' nicer.
I'll quote Jeff:
"Lilaaaaaac wine..."
I voted for Hillers to keep Dave happy.
Lemsip and tea, not in the same cup however.
I'm pretty sure you're making that up, or at least mistaking it.
Do you have a cin.ignore() or cin.get() or something before the function is called?
Also, you should use std::string to read in the file and getline(). It makes it much easier... Also work with lines rather than characters. You could open the file in binary mode and read the whole thing at once if you wanted too... but I can never remember off the top of my head how to do that ;)
#include <string>
// ...
void read_file( void ) {
std::string line, file, f_name;
std::cout<< "What's the filename: ";
std::cin >> f_name;
temp.open( (f_name+".mth").c_str() ,ios::in|ios::nocreate);
while ( std::getline( temp, line ) )
file += line + "\n";
std::cout<< file;
}
By the way... just ran your code there and it doesn't getch() before reading the file for me, so it must be something in your main() code before the function is called.
I'm not certain but I know that a new kind of solar panel was invented recently which makes solar energy as cheap as coal to buy. Good quality panels have been really expensive up to now.
It's not the cost you want though, Dave. I can buy loads of one kind of fuel which isn't good for producing energy. What you're looking for is the highest calorific value with lowest price. What you'll want to consider to know this fuel is probably related to its TOE (Tonnes of Oil Equivalent)... kind of. A tonne of oil will give X Joules. So what you're looking for is the cheapest, with smallest volume, Y to give X watts too... As with most things engineering there are trade offs all over.
>> Yes. Daily.
I haven't... Not in real live, anyways. You see things on TV about it all the time. Especially movies, etc, though the converse exists too. Seems to be in a state of equilibrium for the moment... What do you see, Dave?
>> Seems that young people today just don't know how to party, party, and party some more.
You're just trying to wind us up, I take it!
Happy new year, y'all.
>> tomorrow is my N+ Exam.
As in the second or first? Either way ... nasty.
Does this problem recur every time of just for control panel or security centre?
This probably isn't the best place to get answers for your problem, aftommy, maybe try the windows forums -- http://www.daniweb.com/forums/forum99.html You'll probably find the best help in the correct forum.
>> My mother used to wash my hands with soap, I think that was much smarter.
When you swore on front of her?
"Stop washing my hands, mom, I swear I'll never do it again"... just doesn't have the effect that the mouth would have, I reckon. Not that I've done either.
Like he said :)
I dunno... when I was a kid (R are like 18+, right), I used to like watching those films cause I thought it made me ... more ... cooler, or something. Then when I became old enough to watch them ... meh. They lost their appeal. Now I just watch movies if I think I'll enjoy them. Regardless of their rating.
>> I made love with Megan Fox. That was nasty!
That belongs in the "declining morals" thread, right?
I (now), think of cheating on exams like I do when 12 year old kids who I don't know ask me to buy them cigarettes outside a shop, or something ... I've got to concoct a plan for the next time they ask me ... It annoys me greatly.
>> I learn what I need to know from the people around me.
Do these people watch "the news"? What's even worse is that this 'news' will be passed to you through another source, which will mean it will become even more inaccurate, distorted and yet you're "marginally better off for it"?!
If you want the truth don't limit yourself to one source, as Naure said.
>> Is their any event you want to go back in time for?
Only for grammatical reasons ;)
>> Sounds like a Hollywood movie.
>> I hope it was in Technicolor too.
I hope it was too. I really do. I think it was in Stereo, but I was imagining it so I can't confirm this.
>> that link doesn't work
Yeah. There wasn't any spoiler tag so I had to improvise.
>> Who gets to set the borderlines?
Those who want to feel good about themselves, I guess. Ask any of them if they're fat and I bet they'll say 'no, I'm borderline'.
Well, by playing with the code from the link I got this:
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#pragma comment(lib, "Winmm.lib")
//command, note, velocity
#define MAKE_MSG(X, Y, Z) (X + (Y<<8) + (Z<<16))
#define NOTE_ON 0x90
#define NOTE_OFF 0x80
int main(void){
HMIDIOUT x;
if(midiOutOpen(&x,-1,NULL,NULL,CALLBACK_NULL)!=MMSYSERR_NOERROR ){
printf("ERRORS ahoy\n");
}
midiOutShortMsg(x, MAKE_MSG(NOTE_ON, 62, 65));
_getch();
return 0;
}
I don't know if your code should play anything.
Is the data formatted as above? With each signal on a new line? It should be easy enough to parse then... How many time stamps are there?
>> hey, don't underestimate my colleagues!
I take it you know that the Irish secret-intelligence is so secret that not even the government knows about it, right?
>> I won't embarrass the unit or the female Lance Corporal involved by naming names
i.e. a "close aid to the president", i.e. I made it up!
>> So they leave it as granted and let somebody else tell their kid that they have to stomp the clutch.
And hope that someone mentions the break too!
http://images.google.com/images?q=salem&gbv=2&svnum=50&hl=en&safe=off&sa=G&imgsz=icon
You have to set the image size to small. Avatars are tiny.
>> I like Salem's too. Very original and thought provoking
Yeah. I've been meaning to borrow that for another programming (embedded device), forum where one uses "void main()". Thought it would be amusing.
Hehe. Google-image search "Salem" for small pictures. Daniweb is the first hit.
I thought it was a good idea to go for a swim at the stroke of midnight... but apparently I have a cold now, so maybe not. Then I went for another on the 26th... Seems to have cured the first one but I have another now...