Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 13th, 2005, 11:57 AM   #1
nobrains
Newbie
 
Join Date: Aug 2005
Posts: 6
Rep Power: 0 nobrains is on a distinguished road
cpp problems

hi,
im new to the forum...i just had to clear some doubts, relating to cpp.firstly i hd to ask how to find the ram address of a given variable that has been declared. secondly i wld like to know if it is possible to read thread or process ids using cpp. lastly, i wld like to ask if it ws possible to record sound using cpp...n if so...to calc noise levels.

thts just abt it
thnx
nobrains is offline   Reply With Quote
Old Aug 13th, 2005, 12:40 PM   #2
darkone916
Hobbyist Programmer
 
darkone916's Avatar
 
Join Date: Jul 2005
Location: Oman
Posts: 125
Rep Power: 4 darkone916 is on a distinguished road
Send a message via MSN to darkone916
if u want to see the ram address use this code
[code]
int main()
{
int x;
cout << &x << endl;
return 0;
}
don't forget the & before 'x'.
PS i am a newbie too and am not sure...just trying to help
__________________
From the bottom of the stone steps...
...i'm calling still.
darkone916 is offline   Reply With Quote
Old Aug 13th, 2005, 2:22 PM   #3
prolog
Programmer
 
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4 prolog is on a distinguished road
Hi,

all of the things you've asked can be accomplished using c++ and the apropriate APIs from within.
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup
prolog is offline   Reply With Quote
Old Aug 13th, 2005, 11:25 PM   #4
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5 grumpy is on a distinguished road
Getting the address of a variable is simple: append an ampersand. The result is a pointer (the value of the pointer is the address).

Topics like multithreading (and hence threads) are formally beyond the C++ standard. However, practically, it is possible to work with threads using system specific APIs (eg the win32 API under windows, POSIX under [several] forms of unix). Similar answer for interacting with particular devices (eg sound cards, etc).
grumpy is offline   Reply With Quote
Old Aug 14th, 2005, 2:57 AM   #5
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
I don't want to sound like a roaming asshole, but this is a forum, not a chat room. Your post is hard for me to read, nobrains.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old Aug 14th, 2005, 3:16 AM   #6
stevengs
Professional Programmer
 
stevengs's Avatar
 
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4 stevengs is on a distinguished road
Quote:
Originally Posted by iignotus
I don't want to sound like a roaming asshole, but this is a forum, not a chat room. Your post is hard for me to read, nobrains.
I agree. Those aren't typos,.. just pure laziness.
__________________
-Steven
"Is this a piece of your brain?" - Basil Fawlty
stevengs is offline   Reply With Quote
Old Aug 14th, 2005, 4:07 AM   #7
nobrains
Newbie
 
Join Date: Aug 2005
Posts: 6
Rep Power: 0 nobrains is on a distinguished road
gr8...the ram addr part wrkd...now i have to do the sound and the thread id part
its a serious pain in the ass since i have no experience in api s ...cn nybdy help me there//
nobrains is offline   Reply With Quote
Old Aug 14th, 2005, 4:12 AM   #8
nobrains
Newbie
 
Join Date: Aug 2005
Posts: 6
Rep Power: 0 nobrains is on a distinguished road
ummm...sorry for the lingo guys...i was not aware that you people are not comfortable with it...
i wont resort to it again...i agree it makes the forum look a little sluggish...
so i wont do it again...
nobrains is offline   Reply With Quote
Old Aug 14th, 2005, 6:24 AM   #9
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Wow. A newbie who realises that sometimes other people know best. They're a rare breed. I commend you, nobrains. Good luck with the project.

By the way, you can find out more on this topic by learning about pointers. DaWei wrote a pretty good tutorial on pointers you can find at http://www.daweidesigns.com/pointers.php.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Aug 14th, 2005, 11:13 AM   #10
nobrains
Newbie
 
Join Date: Aug 2005
Posts: 6
Rep Power: 0 nobrains is on a distinguished road
yeah...i do sticik to other's advice at times...i have this habit.
by the way...being called a newbie is not exactly what everybody loves..;p thanks fr your wishes for the project...
i'm still looking fr help with apis...
help me people...
nobrains is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:09 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC