15,551 Topics
| |
Hello guys, I have this function: [CODE=c] void swap(char **a, char **b) { char *tmp=*a; *a=*b; *b=tmp; } int main() { char *str1="aaa"; char *str2="bbb"; swap((char **)&str1, (char**)&str2); return 0; } [/code] The program runs and really swaps the two strings. I don't understand why we send (char**)&str1 and (char**)&str2 … | |
hello sirs. im trying to turn two 8-bit hex characters that represent the lsb and msb of an integer. below is the code i am using. i am getting output though im not sure of the validity. [CODE] char a = 0x01; //msb char b = 0x3D; //lsb short int … | |
hello, please help me with the code for IR CONTROL using ATMEGA128 MICROCONTROLLER IN C LANGUAGE.PLEASE HELP.URGENT. THANKYOU. | |
Hi all, I'm new to the software package and have written a simple code to turn LED's on/off using a Micro Controller device. When away from the Micro Controller, it would be handy to view the bit orientation (turning on/off) on the computer screen, without the actual device to hand. … | |
can some one help me why its not copying the file ? [CODE] if(choice = 2) { puts("please open your archive\n"); scanf("%s",&archive); archive_pointer = fopen( archive, "r+b"); //opens the archive puts("please select the file you want to be copied into your archive\n"); scanf("%s",&original_file); open_pointer = fopen( original_file, "r+b"); //opens the … | |
I wrote a C++ program that could sendKey. the code is as Follows; [CODE]s.SendKeys(_T("{Enter}"));s.SendKeys(_T("{Enter}"));[/CODE] this piece if code is inside a function. Now, i need to access this method from a C code. When i added the includes, i get alot of errors. Some says, that you can't access C++ … | |
Hi,everybody.I wrote a program with mikroC for PIC PRO/2009/V2.50 ,to measure a DC voltage input using 16F877A.But it shows the input dc voltage wrongly and uncorrectly[COLOR="Red"];[ it shows 0.014v instead of correct form; 14v ].[/COLOR] I attached my program and its proteus.would you please tell me what is wrong with … | |
I made this code to solve the following problem. On an island chameleons of different color live. Every Monday , the following events occur The number of Black chameleons born is 1000 more than sum of { existing Blue , existing Green and twice the existing White chameleons } The … | |
My source code is being altered by itself after executing once or when a copy of the source code file is made. If i try to execute the source code the 2nd time it wont work. There will be some error as there are some unwanted ASCII characters like rectangle,smiley...etc … | |
Hi everyone. I have a very simple question about converting strings(in hex) into signed integer number. I use strtol, but it does not work at all. char code[]="FFFFFFFF"; int m; m=strtol(code,NULL,16); printf("%d\n",m); but the result is not -1 How can I manage this in C? Best regards. | |
#include<stdio.h> #include<conio.h> #define MAX 5 void initialize(int a[], int n); void display (int a[], int n); void input (int a[], int n); int sum (int a[], int n); int largest (int a[], int n); int smallest (int a[], int n); void main (void) { int array [MAX]; int total; initialize(array, … | |
Hi, I have a little bit of a problem with my client / server apps. I'm trying to build a simple program that resembles a small instant messaging app. So far I've been working on the "user login" and "status change" parts, along with a query to get the status … | |
[CODE] while (choice != QUIT) { choice = get_menu_choice(); if (choice == 1) { while(1)//while loop that i want to break out of { puts("please give your archive a name and a path:\n"); scanf("%s", &archive_name); if( create_pointer = fopen(archive_name, "r") != NULL) { printf("file already exists\n"); continue; } else { … | |
Can anybody temme how to run a pop up window TSR program written in C ..... m unable to create .obj file of .c file.... TC showing ERROR like " TASM.exe not found" and "Linker error"....... | |
i know that the prototype of putchar() is: int putchar(int ch); eventhough its return type is int why does it print ch in character format instead of printing it as its ascii equivalent? | |
Where can we get fine material about OpenCL.....suggest any sites or links.. | |
i want to know how to check if the file already exists before creating the file? [CODE] puts("please enter a file name to create:\n"); scanf("%s", &file_name); create_pointer = fopen( file_name, "ab"); if( create_pointer == NULL) //create file// else { //file already exist// how would you check if the file already … | |
Hello Is it possible to somehow place another string inside a string ? Example: char array1[4]= "!!!" char array2[5]="joey" //Replace e with array1 Output : jo!!!ey Thank you for any kind of input | |
I need an intersection program for my robot;if there is an intersection of roads,the robot should not stop or take a turn,it should follow the straight path rather than turning left or right or just stop. Please help me,its very urgent............ | |
i am using avr atmega8 microcontroller....i am getting no idea how to read the value of a pin,I have used a IR sensor in that pin. | |
I am struck with some floating-point precision. Please help me to get through this. [CODE]main() { int fact,i=5,div=8; float dec=0.427,temp,sum=0; while(i) { temp=dec*10; printf("%f\t",temp); fact=(int)temp; sum=sum+(fact/(float)div); printf("%f\n",sum); dec=temp-fact; div=div*8; i--; } printf("\n The Decimal part= %f",sum); getch(); } [/CODE] [ICODE]Output 4.270000 0.500000 2.700000 0.531250 6.999998 0.542969 9.999981 0.545166 9.999809 0.545441 … | |
Hi, I would like to using POSIX API system calls in C, and via command line arguments know how to go about extracting from an archive file.(in Linux). I have done the archiving process it archives the files I enter into the command line , and the last but one … | |
I'v written the program below, but I'v been told its too "intense" Any ideas on how I can get the same results but with a simpler program? [CODE]#define MAX_SIZE 10000 char buf[MAX_SIZE], name[1000]; int min(int a, int b) { return a<b?a:b; } int main(int argc, char** argv) { FILE *out, … | |
Hi there)) I cann't deal with the file opening operation - [CODE]char* fpath = "D:\TC\myprog\readit.txt"; FILE* fp; fp = fopen (fpath, "r"); if (fp != NULL) printf ("\n(!) File opennig error\n"); else printf ("\n(+) File have been opened successfully!\n"); for( i=0;i<=n-1;i++) { a = getc(fp); putchar(a-48); putchar('\n'); }[/CODE] For some … | |
hi everyone)) Please tell me - where is the mistake here - [CODE]struct address {char* city ; char* street; int housenumb ;}; struct addinf {int age; struct address* address;}; struct student {int number; int kurs; char* name ; struct addinf* addinf;} stud; stud.number=1; stud.addinf.address.housenumb =123;[/CODE] thanks in advance) |
The End.