15,551 Topics

Member Avatar for
Member Avatar for COKEDUDE

I am using fgets to read lines of a file. I am then using if statements based on the location of the new line character to decide which sscanf to use. I have been getting a lot of windows files which usually use carriage returns. Most of the timeit "seems" …

Member Avatar for rubberman
0
806
Member Avatar for Tariq Amin

what is the usage of getch() function? how to creat recovery softwear?

Member Avatar for Ancient Dragon
0
161
Member Avatar for naveen1993

Help me with ur inputs, how to insert and move the image using C language.. we can use by using "Type Argument Approach" to move the image??

Member Avatar for Ancient Dragon
0
110
Member Avatar for dennis.ritchie

My IDE codeblocks 10.05 cant run a program which is overloading functions. Any help please..maybe due to settings

Member Avatar for Ancient Dragon
0
211
Member Avatar for Sai Ravi Teja
Member Avatar for Ancient Dragon
0
124
Member Avatar for COKEDUDE

I am trying to copy a string to an array of string. I have used these two examples before and they have worked so I don't understand why they won't work this time. I am getting a segmentation fault. http://stackoverflow.com/a/1088667/985898 http://stackoverflow.com/a/1095006/985898 I remembered to initialize everything. char *strings_mneumonic_table[503] = {0}; …

Member Avatar for rubberman
0
1K
Member Avatar for COKEDUDE

How would you go about converting a decimal value to hex and then do math? Every example of converting decimal to hex that I have seen creates an array and I wouldn't be able to do math if I did that. Something like this. 15 decimal to hex F 17 …

Member Avatar for JasonHippy
0
289
Member Avatar for COKEDUDE

I have an array of characters. I am trying to find "houston". The only way I can think of to do this is to use a for loop and check each individual character. Is there an easier way to do this? char string[] = "Fishing tourism miami atlanta dallas houston";

Member Avatar for COKEDUDE
0
207
Member Avatar for Xheis

Hi, I have to create a program that creates N child processes, and they muliply the matrix. I have some base codes but when I try to run them they give me segmentation error and I cant find the problem. #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> #include <sys/types.h> …

Member Avatar for David W
0
305
Member Avatar for ubhart

Hi, I am making program that finds solution how to put 12 knights(horses) to chess board that every square is dominated or engaged by other knight. Look at my code: #include <stdio.h> #include <stdlib.h> #include <stdbool.h> //(*******************************************************************************) void addNulls(char L[][9], int N[], int M[]) { int i,j,g; for (i=1 ; …

Member Avatar for ubhart
0
273
Member Avatar for COKEDUDE

I am trying to clear the first character of my array. The first two methods don't seem to work. The third method seems to but doesn't look like a good idea. char operand[] = "abc"; //both methods seem to null it out operand[0] = 0; memset(operand, 0, 1); printf("%s", operand); …

Member Avatar for Schol-R-LEA
0
129
Member Avatar for ubhart

Hi I have to write program that finds a solution how to put 12 knights to a 8x8 chess board that every square would be dominated by one of the 12 knights. Do you have any suggestions from where I can start?

Member Avatar for ubhart
0
392
Member Avatar for soundarya_1

Write a program that takes two input strings S1 and S2 and finds if S2 is a substring of S1 or not. If S2 is a substring of S1, the program should print the index at S1 at which there is a match. If S2 is not a substring of …

Member Avatar for cxzei
0
144
Member Avatar for neha_8

I wrote this code to find if string s2 is a substring of string s1. However I'm getting time limit exceeded. How can I make my algorithm better? #include<stdio.h> int main() { char s1[20], s2[20]; scanf("%s %s", s1,s2); char *p, *q, *count; p=s1; q=s2; int i=21; do{ if(*p==*q) /* the …

Member Avatar for neha_8
0
191
Member Avatar for adhirgukt

I'm using gcc compiler in linux ubuntu os. I's started doing windows programming in c but my compiler does not having windows.h or supporting header files. How can i include these windows programm supporting files? Can i download them externally or what else.......?

Member Avatar for invadev
0
12K
Member Avatar for shadowplayer28

when converting iget erros especially in the cin parts because they are automatically passed by something #include<iostream> #include<conio.h> #include<math.h> using namespace std; int p=1; class Bank { public: char name[50],address[90],type; double ein_betrag, aus_betrag; double balance; int costumernr, accountnr, birth, tel; public: void newcostumer(); void newaccount(); void costumerdel(); void accountdel(); void …

Member Avatar for Schol-R-LEA
0
312
Member Avatar for Mohammed_9

How can one code a function to remove all trailing blanks from the right end of a string, assuming i use void trimRight(char a[]);

Member Avatar for Mohammed_9
0
130
Member Avatar for Mohammed_9

I am having problem getting the final result here, it keeps on looping. #include<stdio.h> #include<string.h> #include<conio.h> #include<math.h> #include<stdlib.h> #include<ctype.h> int main() { int i, t, k, max, min, sumof; printf("Enter number of integer elements in array: "); scanf("%d",&t); int a[t]; printf("Enter list of array: \n"); for ( i = 0; …

Member Avatar for Mohammed_9
0
180
Member Avatar for soundarya_1

Write a program that reads an MxN matrix A and prints its elements in spiral order. You should start from the element in the 0th row and 0th column in the matrix and proceed in a spiral order as shown below. 1→ 2→3→ 4 ↓ 5→ 6→ 7 8 ↑ …

Member Avatar for David W
0
131
Member Avatar for NEMO_1990_2007

The greatest common divisor of integers x and y is the largest integer that evenly divides both x and y. Write a recursive method Gcd that returns the greatest common divisor of x and y. The Gcd of x and y is defined recursively as follows: If y is equal …

Member Avatar for David W
0
521
Member Avatar for vineeth28

#include<stdlib.h> #include<stdio.h> #include<string.h> struct D { char name[20]; float balance; }d; struct C { char name[20]; int count; }c; char ch; struct A { char command[20]; char name[20]; char filename[25]; float amount; }a; struct P { char name[20]; }p; int main(char argc, char**argv) { struct A b; char str[100]; FILE …

Member Avatar for Schol-R-LEA
0
176
Member Avatar for Xheis

Hi. I found this code online: #include <stdio.h> #include <sys/types.h> #include <sys/wait.h> #include <unistd.h> #include <sys/uio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> /*********************************************************************** * Global Constants * ********************************************************************/ #define A_ROW 2 #define A_COL 3 #define B_ROW 3 #define B_COL 2 #define ARGUMENT_COUNT 13 #define PIPE_QTY 4 /*********************************************************************** * Global Variables …

Member Avatar for Ancient Dragon
0
178
Member Avatar for Mohammed_9

#include<stdio.h> #include <file.h> main(int argc, char *argv[]) { FILE *fp; char s[100]; int i; //char exit if((fp=fopen("Allah ya isa.mp3","rb"))==NULL) //Open file and read on binary mode { printf("Could not open the file\n"); // exit(1); } fclose(fp); } #include<stdio.h>`` main(int argc, char *argv[]) { FILE *fp; char s[100]; int i; //char …

Member Avatar for Ancient Dragon
0
325
Member Avatar for gg_bata

guys Im a newbie here I really need your help for our project...pls help me..heres the problem..Write a C program that add a names into a file then read the names in a file and sort it alphabetically..(FILEPOINTER).

Member Avatar for Schol-R-LEA
0
169
Member Avatar for vineeth.shankar1

Hi, my requirement is that I do gets and take user name as input. Now I have to create a file name with the same name as user name. Next if I try to login as a same user from different client I need to check if that file with …

Member Avatar for Ancient Dragon
0
107
Member Avatar for mohit_c

#include<stdio.h> #include<stdlib.h> int main() { int i,j; int ascii_value; char c; FILE *plain; plain=fopen("xx.dat","r"); while((c=getc(plain))!=EOF) { ascii_value=c; printf("%d %c\n",ascii_value,c); printf("~~~~~~~~~~~~~~~~~~~~\n"); } fclose(plain); return 0; } the file xx.dat is 12sdfsldkfj MY output is 49 1 ~~~~~~~~~~~~~~~~~~~~ 50 2 ~~~~~~~~~~~~~~~~~~~~ 115 s ~~~~~~~~~~~~~~~~~~~~ 100 d ~~~~~~~~~~~~~~~~~~~~ 102 f ~~~~~~~~~~~~~~~~~~~~ 115 s …

Member Avatar for pritaeas
0
176
Member Avatar for mohit_c

#include<stdio.h> #include<stdlib.h> int main() { int i,j; int ascii_value; char c; FILE *plain; plain=fopen("xx.dat","r"); while((c=getc(plain))!=EOF) { ascii_value=c; printf("%d %c\n",ascii_value,c); printf("~~~~~~~~~~~~~~~~~~~~\n"); } fclose(plain); return 0; } the file xx.dat is 12sdfsldkfj MY output is 49 1 ~~~~~~~~~~~~~~~~~~~~ 50 2 ~~~~~~~~~~~~~~~~~~~~ 115 s ~~~~~~~~~~~~~~~~~~~~ 100 d ~~~~~~~~~~~~~~~~~~~~ 102 f ~~~~~~~~~~~~~~~~~~~~ 115 s …

Member Avatar for Ancient Dragon
0
225
Member Avatar for Singh.saurav.5070

A company provides his staff 20% off for tour allowance of basic his basic salary and 10% off for housing rent allowance.calculate the salary in unsigned int.

Member Avatar for Schol-R-LEA
0
164
Member Avatar for henrimontreal

I am working on a Texas Instrument's Board which has MSP430f47197 and the has the following code (C files). The current resolution for kWhs is .01 but I need higher than this. I changed the code to some extent but unfortunately I could not hit it to what I need! …

0
115
Member Avatar for Pepp

Hello! I would like to ask you for help about this: Create a program in C that inputs a random number from the keyboard( long long ), finds the sum of the numbers formed by the digits, grouped in pairs starting from the one and displays the character equivalent of …

Member Avatar for Pepp
0
247

The End.