|
Arefeh Haghpnah wrote: source code car firetruck in c
You should choose the joke icon, though.
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]
|
|
|
|
|
Arefeh Haghpnah wrote: source code car firetruck in c
Here it is:
http://www.firetrucksourcecode.info[^]
Important before you compile the code:
#ifdef Emergency
#define WaterPressure 1
#else
#define Siren 0
#endif
Go and never darken my towels again - Groucho Marx
|
|
|
|
|
You seem to be confused, firetrucks don't have a source code but a chassis.
"I love deadlines. I like the whooshing sound they make as they fly by." (DNA)
|
|
|
|
|
Unless your firetruck hits a firewall, there will be no source code involved.
|
|
|
|
|
hi guys, i came up with a problem. I have 4 GB file(disk size) and i want to read this file in my 2 GB(primary memory) machine.
Please suggest the best method to do so?
Величие не Бога может быть недооценена.
modified on Tuesday, December 21, 2010 2:57 AM
|
|
|
|
|
You can always read data in chunks. Do you mean how to load the entire 4GB into RAM?
|
|
|
|
|
Not exactly, i want to find some data in that file.
So need to until that point is enough, but that search may be on last part.
So i need a mechanism to do so.
I believe CreateFileMapping can be used, do u think, its a good solution?
Величие не Бога может быть недооценена.
|
|
|
|
|
So you indeed need to read data in chunks as I said. Load a chunk and perform the search. Keep loading the next part of the file into the chunk until you get the data.
To do this, you may use memory mapped file or one of the various read(...) functions (Win32 API, CRT etc). Either way, you would still have to read the file in chunks.
|
|
|
|
|
Good Day, is anyone manage to convert the function to DLL? I am not a C++ or C# developer... I have no clue how am I going to convert the whole thing to vb.net version. Can you help? Thanks
|
|
|
|
|
|
Teoh Chia Wei wrote: is anyone manage to convert the function to DLL?
What function are you talking about, and why do want to convert it to a DLL?
Teoh Chia Wei wrote: I have no clue how am I going to convert the whole thing to vb.net version.
Convert from what? And what does this have to do with C/C++?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
This is a strange question. DLLs export functions, so I guess you're asking how to make a DLL that exports the function? I suggest you read up on DLLs.
Steve
|
|
|
|
|
Sorry... this is my problem... I have no experience in C++ although I understand the logic in this feature... but I want to write it in VB.net. Instead of thinking how all the Windows libraries that work similarly like C++. I was thinking of compile this C++ project into DLL so that I can import the DLL in my VB.net. Unfortunately, it doesn't work that way.
Or, you guys as experts... got any idea what should I do with this? Thanks
|
|
|
|
|
|
Hi,
I faced few interview questions in C++. I'm new to C++. Please let me know the answers for the below questions.
* Whats the lookup plan for hash table and linkedlist
* Use of Red-Black Tree
* which datastructure is preferrable to store name, address and phone values
* How mutex works internally
Thanks in advance
modified on Monday, December 20, 2010 6:58 AM
|
|
|
|
|
Rather than asking someone to give you answers to pass your interview, you would do better to buy a book on C++ and learn it before attempting such an interview.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Some brief answers...
1. Hash tables can look up items very quickly, at the cost of more space and a fixed size. This is their main advantage. A linked list is good for unknown amounts of data; it grows as you add more data. Lookup requires going though (on the average) half the list, so is generally slow.
2. A red-black tree uses one extra bit of storage per node to avoid the worst-case binary trees (skewed). (A scapegoat tree accomplishes this without the 1-bit overhead per node.)
3. A class.
4. All mutual-exclusion mechanisms ultimately depend on an atomic test-and-set operation, which determines if another thread is accessing a critical resource, and sets a flag at the same time if the resource is free. This must be done by hardware; if this capability isn't available, no pure-software solution will be able to provide mutual exclusion.
|
|
|
|
|
Thanks alot Alan. Is a class of type datastructure?
|
|
|
|
|
HaroldVish wrote: Is a class of type datastructure?
It's more of a fancy struct . See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
At What Conditions,
CStudioFile::ReadString() Gives/Returns the FALSE value?
I know that,What is available in the MSDN ,
AnyBody Know the another Conditions Please,
Tell me.
And
In a File Consists the Lines In one Condition "m_pString" doesn't take the line in the File?
Why it Happen? Any body know Please give me Reply....
|
|
|
|
|
What make you think there are other condition than what is describe in the documentation ? Do you have a test case that will trigger a FALSE ?
It returns FALSE (or NULL depending on which version you call) if no data is read before the end-of-file.
John502 wrote: In a File Consists the Lines In one Condition "m_pString" doesn't take the line in the File?
What does that mean :
Watched code never compiles.
|
|
|
|
|
Hello Maxi,
Thanks for helping in this regards; I want to run my test case on the below text;
12/13/10 10:11:00 (India Standard Time), [3484] TAPIAdapter.cpp :379 INFO - Closing the database before stopping the service.
12/13/10 10:11:00 (India Standard Time), [3484] TAPIAdapter.cpp :409 INFO - TAPIAdapterDynConfig thread could not be stopped
12/13/10 10:11:00 (India Standard Time), [3484] TAPIAdapter.cpp :429 INFO - "TAPIAdapter Service" Service Stopped
12/13/10 10:11:04 (India Standard Time), [3544] TSPConnector.cpp :166 TRACE - Line is closed for device_id 110
12/13/10 10:11:04 (India Standard Time), [3544] TSPConnector.cpp :166 TRACE - Line is closed for device_id 110
3_VOIP_10202010_00004 made on Oct 20 2010 16:41:29
12/13/10 10:11:00 (India Standard Time), [1508] TAPIAdapter.cpp :793 ERROR - Illegal keyword "CheckExtInCTIUserInterval" in configuration file
12/13/10 10:11:04 (India Standard Time), [1508] CVoipDatabase.cpp :167 INFO - KnoahSoftDB : Connection opened with database at ip address : 157.0.60.155
12/13/10 10:11:04 (India Standard Time), [4108] CCTIOSAdapterKSDB.c :142 TRACE - The SQL Query is :- select v.voip_phone_extension Voip_Phone_Extension,e.emp_code Emp_Code,e.emp_id Emp_ID,e.network_id Network_ID,s.site_alias Site_Alias From Employee E, Site S, Voice_Configuration V, Employee_Detail D Where V.Emp_Id = E.Emp_Id And V.Emp_Id = D.Emp_Id And D.Location_ID = S.Site_ID And V.Status = 'A' And V.Do_Voice_Recording = 'Y' And V.Voip_phone_extension != '-1' and v.emp_id not in (select e.emp_id from employee e where e.emp_first_name like 'extn_agent_%') order by voip_phone_extension
I have this text content in one file and wants to read this by application;
please help me out..
Thanks
John;
|
|
|
|
|
So what is the issue ?
You open the file, read the file line by line with CStdIO::ReadString and do what ever you want with each string :
something like :
CStdioFile myFile(_T("C:\\path\\to\\your\\file.txt"), CFile::modeRead |CFile::typeText );
CString myString;
while (myFile.ReadString( myString ) )
{
std::wcout << myString.GetBuffer() << std::endl;
}
Watched code never compiles.
|
|
|
|
|
|
Watched code never compiles.
|
|
|
|