- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
Re: [code=c] /*decimal to binary*/ #include <stdio.h> void printBinary(const unsigned char val) { for(int i = 7; i >= 0; i--) if(val & (1 << i)) printf("1"); else printf("0"); printf("\n"); } int main() { int dec; int hold=0; printf("Integer number : "); scanf("%d",&dec); printBinary((unsigned char)dec); } [/code] | |
I want to read all files in a particular folder using C programming. HOw to do this. Thanks. Ex: I have some 5 files in folder named c:\temp. I want to read all files one after another and want to write output file for each input file. The output files … | |
Question: Declare a pointer to a function taking an int argument and returning a pointer to a function that takes a char argument and returns a float. I did code as follows. But it is giving error. Please correct this. [code=C] #include <iostream> using namespace std; float func(int x)(char c) … | |
HI, I new to linux device drivers. I am developing HDLC driver. I dont know how to read and write data in memory mapped address. Please help. /*code*/ #define REG_MAP_ADDR 0x50400000 /* Registers */ typedef struct { u16 MOD; u16 STATUS; u16 TBASE; u16 Tx; u16 TxBD; u16 RBASE; u16 … | |
Hi, I am new to Linux device driver, i am developing HDLC-ip driver. i dont know how to do memory mapping. Please guide me how to do memory map. Please find an attachment with this for list of registers and memory map table. | |
I have 2 forms. Form2 has no minimum, max, close icons. Form2 have to control by form1. i.e minimize of form1 becomes form2 minimize. normal of form1 becomes form2 normal. closing of form1 becomes form2 close. All these are working. but when form1 is behind the screen, i.e if form1 … | |
How to wait for some time while writing to a file. I am appending some text in log file, its giving error as Some other process using this file. How i have to wait untill its free. | |
I am trying to do localization of ColumnHeadersDefaultViewStyle property of DataGridView.I need localization in both Japanese and English. While designing the form, i set the Font Style of ColumnHeadersDefaultViewStyle property of DataGridView to "Arial" and changed the Form Language property to "japanese" and set the Font style of ColumnHeadersDefaultCellStyle property … | |
Consider d_type=POINT_LONG in the following program. and data.Long=0xA; In the following program i am getting correct output in constDataArea[0],constDataArea[1],constDataArea[2], constDataArea[3] which is oxA, 0x0, 0x0, 0x0. But not able to write the same into ambi.dat file. Some junk value is inserting in the front. and writing 5 bytes instead of … | |
I wrote the following function and it is working fine, but my problem is i want to write forward pointer address in present pointer field. I will explain in code. please check line numbers 10, 11, 12, 13 in the following code.. [code=c] void create_fbeCodeDat() { int checkSum=0; fwrite(&signature,1, 4, … | |
I wrote the following function. i want to return fbCodeAddr and tmpAddr to the main function. How to do this? Function is as follows; [code=c] void fbExeCode(int BldCnt) { // for(int BldCnt=0;BldCnt<fbdStepno; BldCnt++) { char *fbCodeAddr; char *tmpAddr=0; char *buffer; int n; fbCodeAddr=(char *)malloc(1024); int stack=0; int totalPin=0; for(int fb=0;fb<fbnodeLst.size();fb++) … | |
Hi, I am allocating memory for some areas. For DB i need 1024 bytes, for DS 1024*2 bytes and so on, and i initialised address as follows. I initailise devBaseAddr to DB, because DB comes first, and next DC. DB is 1024 bytes , so for DC=DB+1024. This is DC address. … | |
I have the following function. in this function i am not able to push back in vector. I will explain how it works. if same f_pin will comes in the second iteration compared to first iteration of EventNum loop it will get into if Loop and have to push into … | |
Hi everybody, I want to write enter in a text file. How to do this. I wrote the code as follows. see if i write like this, it is printing one special character like arrow. I want to print in the following line, instead it is printing in single line … | |
I have input files like this a.iup b.iup c.iup....... i have these input files in a variable called fname; like this char *fname="c:\\iupfiles\\a.iup"; every time i will get file name in this variable. But how to concatenate the variable with some other name like as follows in output file name. … | |
hi, i have some data in variables of different types.(short, int, long, float, char, double). now i have to create one pointer, have to allocate 1mb memory and have to store one by one in that pointer. How to do this.. plz give some clues to start.. which type i … | |
I am reading 4 bytes in binary file and stored in some variable named as *tmpbuf. i am printing this variable in decimal value like this. printf("%d",*tmpbuf); But now what to do is i want to split 4 bytes into two and want to read those separately and saved in … | |
The following is giving output as follows String:Astro.cfg Fail If buff is Astro.cfg, it has to give success output, but it is giving fail. I want to print Success.. Please guide me regarding this pointer usage.. [code] #include<iostream> using namespace std; int main() { char arr[]="Asto.cfg"; char *buff=&arr[0]; printf("String:%s",buff); if(buff=="Asto.cfg") … | |
The following program is giving error as follows. please get me the solution how to debug this error. Error: Debug Assertion Failed! Program: ... File: d:\program files\microsoft visual studio 8\vc\include\vector Line: 1556 Expression: ("this->_Mycont != NULL && this->_Myptr != NULL", 0) [code] #include<iostream> #include<vector> #include<deque> #include<list> #include<algorithm> #include<functional> #include "print.hpp" … | |
I wrote the code for Arithmetic, relational and binary operations. Here i have intilaised all inputs. I want to give inputs from keyboard instead of intialisation or direct Push_back from loop. How to do this? Please check the following code and please help me to give inputs from keyboard. [code] … | |
Container V1: 1 2 3 4 5 6 7 I want to print the elements which are greater than equal to 3 but less than 6. How to do this using Standard template library functions.. We have logical_and, greater_equal and less_equal Predefined Function Objects. But i dont know how to … | |
Hi, I need some algorithms with syntax to work out logical operations using Standard template library(STLs). Please get me some examples of these or teach me regarding logical operations using STLs. | |
Hi, I want to replace the numbers which are less than 5 in a container. So i write a code as follows. But it is not working. Please get me the solution for this. Destination container should be V2 itself. Where we have to specify destination container. [code] replace_if(V2.begin(),V2.end(), //range … | |
i am getting error in following program. what is "iota". Why it is giving an error in the following program [CODE] #include<iostream> #include<vector> #include<algorithm> using namespace std; int main() { vector<int> V(10); iota(V.begin(), V.end(), 7); copy(V.begin(), V.end(), ostream_iterator<int>(cout, " ")); cout << endl; cin.get(); } [/CODE] | |
I want to run the following code. Its giving error as "Fatal Error" not able to open 'print.hpp' . No such file or directory.. I didn't understand what is #include "print.hpp". what type of file it is. shall we have to write this header file before executing the program. [code] … | |
Hi, How to do arithmetic and relational operations using Standard Template Library.(STLs). Could any one please guide me regarding this. I am new to Standard Template Library. | |
Hi, I dont know much about Standard template library(Vectors, Lists, Deque). I want to do one Program which is as follows. Write a program to create a data bank which holds the operator and operands of arithmatic/relational/bitwise(etc.,) operations. (Use STLs) The no. of operand fields(input and output) is variable depending … |