Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[dawram@cdmcsczhprd02 hw2]$ gcc hw2. c hw2. c: In function 'bin2dec' : hw2. c:17:14: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] int len = strlen(bin_num) ;

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
[dawram@cdmcsczhprd02 hw2]$ gcc hw2. c hw2. c: In function 'bin2dec' : hw2. c:17:14: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration] int len = strlen(bin_num) ; hw2. c:17:14: warning: incompatible implicit declaration of built-in function 'strlen' hw2. c: 17:14: note: include '' or provide a declaration of 'strlen' hw2. c:3:1: +#include hw2 . c: 17:14: int len = strlen(bin_num) ; hw2. c: In function 'rotate' : hw2. c:27:14: warning: incompatible implicit declaration of built-in function 'strlen' int len = strlen(s) ; ANNANN hw2. c:27:14: note: include '' or provide a declaration of 'strlen' hw2. c:32:8: warning: implicit declaration of function 'memmove' [-Wimplicit-function-declaration] memmove (s, s + 1, len - 1) ; hw2. c:32:8: warning: incompatible implicit declaration of built-in function 'memmove' hw2. c:32:8: note: include '' or provide a declaration of 'memmove' [dawram@cdmcsczhprd02 hw2] $#include NP #include 3 4 5 // Convert 0xF83D7E6A from hex to binary: 11111000001111010111111001101010 6 7 // Convert 11101001 10110111 00011110 10000001 from binary to hex: E9B7181 8 9 // Convert OxCODE from hex to decimal notation: 51678 10 11 // Convert 11010011 from binary to decimal notation: 211 12 13 14 void bin2dec(const char *bin_num) { 15 int len = strlen (bin_num) ; 16 int i, dec = 0; 17 for (i = 0; i 0) { 29 temp = s [0] ; 30 memmove (s, s + 1, len - 1) ; 31 s [len - 1] = temp; 32 n--; 33 34 3536 37 // test code; do not modify 38 int main( ) { 39 char *bin_nums = {"01011101", "1111001111000001", "00111100010110101000000111000011"}; 40 char str1 = "systems"; 41 char str2 = "programming"; 42 char str3 = "assembly"; 43 char *strings = {str1, str2, str3}; 44 int i, j; 45 46 47 printf("=== bin2dec = =\ ") ; 48 for (i = 0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

What is the major drawback of Nvidia GPU?

Answered: 1 week ago