![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Aug 2005
Posts: 6
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
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. |
|
|
|
|
|
#3 |
|
Programmer
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,223
Rep Power: 5
![]() |
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). |
|
|
|
|
|
#5 |
|
Professional Programmer
|
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;} |
|
|
|
|
|
#6 | |
|
Professional Programmer
Join Date: May 2005
Location: Bad Nauheim, Germany
Posts: 436
Rep Power: 4
![]() |
Quote:
__________________
-Steven "Is this a piece of your brain?" - Basil Fawlty |
|
|
|
|
|
|
#7 |
|
Newbie
Join Date: Aug 2005
Posts: 6
Rep Power: 0
![]() |
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// |
|
|
|
|
|
#8 |
|
Newbie
Join Date: Aug 2005
Posts: 6
Rep Power: 0
![]() |
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... |
|
|
|
|
|
#9 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
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. |
|
|
|
|
|
#10 |
|
Newbie
Join Date: Aug 2005
Posts: 6
Rep Power: 0
![]() |
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... |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|