15,552 Topics

Member Avatar for
Member Avatar for richa_talwar08

Hi All, I need to write a code in C or C++ where some text in text_file_1 needs to be replaced with some other text which is in text_file_2. both the text files are stored at some location Text_file_1 has text: user,pass jojo, beans where jojo and beans need to …

Member Avatar for Adak
0
443
Member Avatar for tubby123

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 …

Member Avatar for rubberman
0
123
Member Avatar for vincenzorm117

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 …

Member Avatar for vincenzorm117
0
616
Member Avatar for asrockw7

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(); …

Member Avatar for vegaseat
0
7K
Member Avatar for Mr.UNOwen

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 …

Member Avatar for rubberman
0
132
Member Avatar for sharma89bunty

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 …

Member Avatar for venkata suresh
0
203
Member Avatar for Vinod Supnekar

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 …

Member Avatar for Ancient Dragon
0
430
Member Avatar for dotancohen

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 …

Member Avatar for vegaseat
0
198
Member Avatar for phalaris_trip

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. …

Member Avatar for MonsieurPointer
0
3K
Member Avatar for mitrious

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 …

Member Avatar for mitrious
0
146
Member Avatar for manish250

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 …

Member Avatar for bajishareef
0
141
Member Avatar for darkdai

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.

Member Avatar for Ancient Dragon
0
83
Member Avatar for liora

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 …

Member Avatar for Ancient Dragon
0
98
Member Avatar for Slavrix

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 …

Member Avatar for Slavrix
0
108
Member Avatar for siddiqui_1985

[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] …

Member Avatar for bajishareef
0
179
Member Avatar for pardhu463

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) { ... …

Member Avatar for pardhu463
0
266
Member Avatar for campuzcrazyness

[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 …

Member Avatar for campuzcrazyness
-1
547
Member Avatar for GregMalick

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 …

Member Avatar for GregMalick
0
462
Member Avatar for kandarpa

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 …

Member Avatar for N1GHTS
0
3K
Member Avatar for happyhappyhappy

[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(); …

Member Avatar for Arbus
-1
144
Member Avatar for N1GHTS

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]); …

Member Avatar for N1GHTS
0
202
Member Avatar for pardhu463

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 …

Member Avatar for N1GHTS
0
192
Member Avatar for perksexcuse

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 …

Member Avatar for perksexcuse
0
146
Member Avatar for illIAm

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 …

Member Avatar for Narue
0
201
Member Avatar for happyhappyhappy

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 …

Member Avatar for Salem
0
151
Member Avatar for localp

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 …

Member Avatar for localp
0
162
Member Avatar for Nicco

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 …

Member Avatar for Nicco
0
2K
Member Avatar for metal_man

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 …

Member Avatar for TrustyTony
0
486
Member Avatar for DOT6

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 …

Member Avatar for Narue
0
251
Member Avatar for super.mina

The user enters the following : " x+sin(x)-pow(x,2)+5log(x)" How can I make parsing for a statement like that .

Member Avatar for WaltP
1
129

The End.