15,551 Topics
| |
hi , getw() is used to read the next INTEGER from a filestream right ? Assume ------- My text document has the following 12 i am an 3 4 intern 5 67 Expected output --------------- Then , i expected that, on running getw() inside a while loop, it would print … | |
Before you read, I am using Mac's Xcode. In this program I am attempting to print the maximum and minimum values of standard C variables with every variation of modifiers. The unsigned int uses 4 bytes therefore it must have a maximum value of 4294967296 but it only display 2147483647 … | |
I wanted to know what integer/ASCII code the arrow keys were so I can get some programming exercise going. My test somehow evolved into this: [code] int x = getch(); printf("%c\n", x); x = getch(); printf("%c\n", x); x = getch(); printf("%c\n", x); x = getch(); printf("%c\n", x); x = getch(); … | |
Hello, I'm working on a project using the arduino board that connects to my computer via USB. Anyway, I opened the "file" (FYI using linux) for the board using the fopen call and I'm wonder if there's a way to check if there's data ready to read in. Also I … | |
sir i have a problem in the c program. [CODE]switch(ch) { case 1: t=a+b;break; case 2: t=a-b;break; case 3: t=a*b;break; case 4: t=a/b;break; default:printf("invalid no:"); }[/CODE] when i execute the program and the any choice the comipler skip to the default statement. is it any problem in the syntax. sir … | |
Hey hi , i want to read input frm user fm command prompt(Cmd)!!And aslo print it on Cmd. Now if i use [CODE] #include <stdio.h> main() { int c; while ((c=getchar()!=EOF)//get the sinle char putchar(c);//prnt it on cmd } [/CODE] But i dnt knw how to enter EOF as i … | |
I just read in K&R that a function, even if not defined as void, need not return a value. To test I wrote a quick power function and I'm getting reproducible yet unexpected behaviour: [code]✈demios:cliC$ cat power.c #include <stdio.h> int power(int x, int y); int main() { printf("%d\n", power(2,5)); return … | |
I was trying to revise my linked list and implement it in C to check if there is a difference in performance... just as a sort of weird hobby.. In the absence of templates I'm trying to figure out how to pass a type as a parameter for this purpose. … | |
Here's my problem. I'm trying to write info to a bin file, consider the following piece of code: [CODE]FILE *fp = fopen("banco\\banco.bin", "ab"); char buffer[22]; sprintf(buffer, "55555555 111111 11111"); fwrite(buffer, sizeof(char), 22, fp); fclose(fp);[/CODE] when I run this it writes to the file that line twice when I print it … | |
hello all i have been writing the java code and new to C programing.I am very confused in point.i have the following code [CODE]#include<stdio.h> main() { int *ptr=50; printf("%d",*ptr); return 0; } ~ ~ [/CODE] why it is giving the segmentation fault.and when i print ptr then it gives value … | |
hey guys, i was wondering if it was possible to display something in a different language like Arabic or any other language in a printf() statement. | |
Hi! good morning! I am writing a program, that uses interaction between 5 processes(using signals), I am trying to use in one of them- gets command to get a command from the user. And it seems that gets isn't working.. Maybe one of the other processes interrupts the work of … | |
hey ive mostley got this working however im not sure if im reading the binary file correctly because for some reason its playing up, anyone able to give it a look over ? also i know in my sort function, there is an issue with the comparing of the values … | |
[code]#include<stdio.h> #include<conio.h> void main() { char gender,Mar_stat; int age; clrscr(); printf("Enter your Marital Status "ma" or "um":\n"); scanf("%c",&Mar_stat); if (Mar_stat == 'ma') { printf("Enter your Gender And Age :\n"); scanf("%c %d",&gender,&age); if (gender=='M' && age >= 30) { printf("You are Insured"); } else { printf("Sorry"); } getch(); } } [/code] … | |
Hi to all... I am getting a warning, i am trying to avoid that but its not sorted out..Please suggest me to avoid that warning. my code is as follows.. [CODE] const char var[][2][5]={ {"1.95","3.70"}, {"2.40","4.60"}, {"2.70","5.70"}, {"6.60","13.40"}, . . . . }; void fun(int col,int row,char *str) { ... … | |
[code] #include <stdio.h> main() { int ctr, bin, quotient, deci=0, binary,octal,hexa; float rem; char mark_magic; clrscr(); do { clrscr(); quotient = 1; binary = 1; gotoxy(32,3); printf("-=< MAIN MENU >=-"); gotoxy(15,5); printf("from any Number System to Decimal System conversion"); gotoxy(5,6); printf("------------------------------------------------------------------------"); gotoxy(5,7); printf("------------------------------------------------------------------------"); gotoxy(26,9); printf("[A] Binary System"); gotoxy(26,11); printf("[B] Octal … | |
Here's the problem I'm trying to solve: I've written a DLL that's used as a plugin within another program. Within the DLL is a number of structure allocations which represent the positions of points in a mesh (over time). These allocations can be very very large. If another instance of … | |
Hi, I am allocating memory using [B]malloc()[/B] and then I am filling the aloocated memory with "0" using [B]memset()[/B]. The combination of [B]malloc()[/B] and [B]memset()[/B] are being called many times in my project. After adding memset() function affecting my project's performance. So I am searching for the alternative for the … | |
[code] void generalboard(); void inputuser(int*pt1, int*pt2,int*pt3); void checkwins1d(int*A,int*B, char C[][3][3]); void checkwinsup(int*A,int*B,char C[][3][3]); void checkwins3D(int*A,int*B,char C[][3][3]); void inputcomputer(int*pt1,int*pt2,int*pt3,char A[][3][3]); void score (int a, int b); void displayboard(int a, int b, int c, int i, int j, int k, char board [][3][3]); int main () { int i,j,k,a,b,c,computerscore=0,userscore=0,counter=0; char board[3][3][3]; generalboard(); … | |
I have been coding in C for a very long time, and I thought I had it all figured out, until I saw this code in an MD5 library: [code] static void MDPrint (mdContext) MD5_CTX *mdContext; { int i; for (i = 0; i < 16; i++) printf ("%02x", mdContext->digest[i]); … | |
Hi to all, I am new to this forum..If i did any thing wrong in this thread please correct me... Let me tell you something about my project .... I am working on ARM7-LPC2148 processor with Graphical LCD. Now i am making a calculator which should be like as our … | |
Hello DaniWeb! I've found your website very useful for previous problems in my course, but this time I've come across something I just can't figure out. I'm attempting to create a program thats instructions are defined in the code. I've used a previous post as a guideline, and it was … | |
Hi i got this progamm working fine it is supposed to read a comma delimited text file store as an array and the output a formatted version The problem is its outputting something really weird I dont know why. [B]The text file it is supposed to read[/B] [code=text]Darwin,3,33 Darwin,1,11 Darwin,6,66 … | |
Hey guys, I am interested into making a 3D tic tac toe game, but right now I am stuck. I created a 3D string... like board[3][3][3]. and each time the user type in numbers between 0 to 2...and the computer does the same too. I played a few 3dTTT game … | |
I am new to C, hope someone could help me here. I need to implement a keystroke, for example, i need to programatically implement the 'return key'. As in if someone is pressing the 'return key' from the keyboard. but here, the user will not even touch the keyboard. the … | |
Hi there, I'm working on a map for a class assignment and running into trouble. I've tried looking around the web but couldn't find anything that helped. I know how insertion works on a basic level when returning a node pointer but think i'm missing some key ideas when using … | |
Hi to all. It's my first post here. I want to ask about 2D Gabor filter implementation. I have some code but it is not working. So let me present my work first: [code=c]signed int sumX, sumY; long int SUM = 0; int I = 0, J = 0; double … | |
Hello all, I have been working on a card game for the last month or so and sofar have created the basics ie. cards, deck... The language is ANSI-C and is created in programmers notepad with devkitpro and MLlib. Everything is working greate so far as in I can shuffle … | |
The user enters the following : " x+sin(x)-pow(x,2)+5log(x)" How can I make parsing for a statement like that . | |
Hi, I am trying to make a program which reads 6 integers , insert into a file numbers1.txt then copy numbers1.txt content to numbers2.txt and finally print numbers2. The problem I have is that when I am trying to copy the file to another the system crashes. My code is … |
The End.