low-level-code

c++ difference between reinterpret cast and c style cast

放肆的年华 提交于 2019-12-21 02:43:28
问题 Code: char keyStr[50]={ 0x5F, 0x80 /* bla bla */ }; uint32_t* reCast = reinterpret_cast< uint32_t* >( &keyStr[29] ); uint32_t* reCast2 = ( uint32_t* )&keyStr[29]; if( reCast == reCast2 ){ cout << "Same Thing!"; } Output: Same Thing! I wonder what's the difference between the two casting methods. Also if you could specify ( with examples ) difference between static_cast, dynamic_cast, and other types of casting you know ( i.e. while staying as low level and as close to assembly language as

Where can I find low level Sound Programming Theory Tutorials

倖福魔咒の 提交于 2019-12-18 13:39:16
问题 I am an intermediate graphics programmer. I want to learn audio/sound processing theory from the ground up. Just like how "A pixel" and its components R,G,B,A is the fundamental part of Graphics programming. I want to know about sound programming in similar lines. Can anyone point me to good links? Also I would like to know some libraries (preferably portable) which allow me to manipulate sound. Something which can directly work on mp3, amr files. I don't mind book recommendations too :) 回答1:

How to split hex byte of an ASCII character

元气小坏坏 提交于 2019-12-07 18:04:49
问题 What basically i want to do is For eg: 'a' hex equivalant is 0x61 , can i split 61 in to 6 and 1 and store them as '6' and '1' ? A buffer is receiving data like this: rx_dataframe.data[0] is H'00,'.'// H' is Hex equivalant and '' is ASCII value rx_dataframe.data[0] is H'31,'1' rx_dataframe.data[0] is H'32,'2' rx_dataframe.data[0] is H'33,'3' I need to to convert hex values 0x00,0x31,0x32,0x33 in to char value '0','0','3','1','3','2';'3','3' and to store them at the locations of tx_buff_data[]

How to split hex byte of an ASCII character

一个人想着一个人 提交于 2019-12-06 05:19:17
What basically i want to do is For eg: 'a' hex equivalant is 0x61 , can i split 61 in to 6 and 1 and store them as '6' and '1' ? A buffer is receiving data like this: rx_dataframe.data[0] is H'00,'.'// H' is Hex equivalant and '' is ASCII value rx_dataframe.data[0] is H'31,'1' rx_dataframe.data[0] is H'32,'2' rx_dataframe.data[0] is H'33,'3' I need to to convert hex values 0x00,0x31,0x32,0x33 in to char value '0','0','3','1','3','2';'3','3' and to store them at the locations of tx_buff_data[]; I want my tx_buff_data look like this tx_buff_data[0] have H'30,'0' tx_buff_data[1] have H'30,'0' tx

c++ difference between reinterpret cast and c style cast

末鹿安然 提交于 2019-12-03 09:48:55
Code: char keyStr[50]={ 0x5F, 0x80 /* bla bla */ }; uint32_t* reCast = reinterpret_cast< uint32_t* >( &keyStr[29] ); uint32_t* reCast2 = ( uint32_t* )&keyStr[29]; if( reCast == reCast2 ){ cout << "Same Thing!"; } Output: Same Thing! I wonder what's the difference between the two casting methods. Also if you could specify ( with examples ) difference between static_cast, dynamic_cast, and other types of casting you know ( i.e. while staying as low level and as close to assembly language as possible ). static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style

Learning about Java bytecode and the JVM

末鹿安然 提交于 2019-12-03 01:42:55
问题 In a recent question asked recently my simple minded answer highlighted many of my misconceptions about Java, the JVM, and how the code gets compiled and run. This has created a desire in me to take my understanding to a lower level. I have no problems with the low level understanding like assembly how ever bytecode and the JVM confound me. How object oriented code gets broken down on a low level is lost to me. I was wondering if anyone had any suggestion on how to learn about the JVM,

Learning about Java bytecode and the JVM

人盡茶涼 提交于 2019-12-02 15:40:00
In a recent question asked recently my simple minded answer highlighted many of my misconceptions about Java, the JVM, and how the code gets compiled and run. This has created a desire in me to take my understanding to a lower level. I have no problems with the low level understanding like assembly how ever bytecode and the JVM confound me. How object oriented code gets broken down on a low level is lost to me. I was wondering if anyone had any suggestion on how to learn about the JVM, bytecode and the lower level functioning of Java. Are there any utilities out there that allow you to write

C low-level standard-in to accept filename then printing file contents to stdout

瘦欲@ 提交于 2019-12-02 02:25:45
问题 I want to get a file name from a user via stdin, open the file with open() and assign it to a file descriptor, then print the contents of that file to stdout. This is my code, and it's not working properly. Problems: the printf("enter filename"); statement is never showing up it never opens the file; instead whatever the user inputs is printed to the screen and then the "no such file or directory" error message is printed and the program exits after the program exists i see "enter filename"

C low-level standard-in to accept filename then printing file contents to stdout

Deadly 提交于 2019-12-02 00:21:56
I want to get a file name from a user via stdin, open the file with open() and assign it to a file descriptor, then print the contents of that file to stdout. This is my code, and it's not working properly. Problems: the printf("enter filename"); statement is never showing up it never opens the file; instead whatever the user inputs is printed to the screen and then the "no such file or directory" error message is printed and the program exits after the program exists i see "enter filename" printed before the prompt in terminal CODE: { printf("Enter the filename: "); read(STDIN_FILENO,

Where can I find low level Sound Programming Theory Tutorials

和自甴很熟 提交于 2019-11-30 10:25:39
I am an intermediate graphics programmer. I want to learn audio/sound processing theory from the ground up. Just like how "A pixel" and its components R,G,B,A is the fundamental part of Graphics programming. I want to know about sound programming in similar lines. Can anyone point me to good links? Also I would like to know some libraries (preferably portable) which allow me to manipulate sound. Something which can directly work on mp3, amr files. I don't mind book recommendations too :) Before getting your hands dirty with the very low levels (C/C++) I'd suggest playing around with higher