| | |
Curious working with objects
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
cpp Syntax (Toggle Plain Text)
struct Table { char* aTag; char* bTag; }; int main() { Table T1; cout<<T1.aTag; cout<<T1.bTag; return 0; }
This might be crazy but... i really need to know
is there any way to so that we can only write
cpp Syntax (Toggle Plain Text)
cout<<aTag cout<<bTag
T1.aTag like we do in namespace by using namespace <something> for a block.Can in be done for pointers
T1->aTag .I tried something but have to write each of them for different object...
Last edited by Rhohitman; Oct 2nd, 2009 at 6:20 pm.
Chazing Dreams ;'P
Shhhh.......ZZzzzzzzzzzzzzzzzzzzzz.....
Shhhh.......ZZzzzzzzzzzzzzzzzzzzzz.....
Why ?
Maybe something like this :
Maybe something like this :
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <string> using std::cout; using std::string; using std::endl; namespace Curious { string mystery = "Magic"; struct Wonder { Wonder(string msg) { mystery = msg; } }; } int main() { using namespace Curious; cout<<mystery<<endl; Wonder why("What is going on ? "); cout << mystery << endl; return 0; }
1) What word becomes shorter if you add a letter to it?
[ Solved by : niek_e, Paul Thompson, SgtMe, murtan, xavier666, jonsca]
2) What does this sequence equal to : (.5u - .5a)(.5u-.5b)(.5u-.5c) ...
[*solved by : murtan, xavier666]
3) What is the 123456789th prime numer?![]() |
Similar Threads
- Good Python IDE (Python)
- Assistant C++ Programmer (Software Development Job Offers)
- My first "real" C program... tell me what you think... (C++)
- Counting Spaces in a string (C++)
- Having problems saving objects into an array, then accessing the data later for repo (Java)
- Unable to search from the address bar. (Web Browsers)
- Working with objects of different Classes (Java)
- mod_rewrite question (Linux Servers and Apache)
Other Threads in the C++ Forum
- Previous Thread: vector help
- Next Thread: Convert Decimal to any base
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bitmap bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator getline graph homeworkhelp homeworkhelper iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multiple newbie news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg simple sorting string strings template text tree url vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






