LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-05-2015, 02:42 PM   #16
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,186

Rep: Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865Reputation: 865

To see how structs are used and declared download the attached file to /tmp rename it and set the execute bit, then run it like so
Code:
cd /tmp
mv CScript.cc.txt CScript.cc
chmod +x CScript.cc 
./CScript.cc
You should get this:
Code:
Data pointed to by rq: x (int) = 666, y ( const char*) Hello world
Data in static structure staticsrqtruct: x (int) = 999, y ( const char*) Goodbye world
Notice the structure is only declared once but two instances are created.
Attached Files
File Type: txt CScript.cc.txt (619 Bytes, 11 views)
 
1 members found this post helpful.
  


Reply

Tags
iaodv, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gdb, debug with separate debug file and different source dir problem a4z Programming 5 10-17-2014 01:55 AM
gdb and django test server, debug a shared library jason_m Programming 3 07-03-2013 07:03 PM
Load test, boundary test & stress test for USB EHCI/xHCI driver rama_toshiba Linux - Kernel 5 02-29-2012 02:43 PM
[SOLVED] Not able to debug a library compiled with debug information gregorian Programming 6 10-29-2011 09:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration