15,551 Topics

Member Avatar for
Member Avatar for Nikolas9896

**WHY StrCpy - dosen't work normally :( ? Where is mistakes?** #include"string.c" int main() { printf("Hello World!\n"); char *text = "GOOOD TEXT ALL TIME VERY POOR "; int temp = strlen(text); char *copy_text; printf("size text: %d\n", temp); StrCpy( copy_text, text ); printf("TEXT: %s\n COPY_TEXT %s", text, copy_text ); return 0; …

Member Avatar for Banfa
0
211
Member Avatar for Stefan_2

This is what I have to code. Input an array of numbers(any numbers that user inputs from standard input, aka keyboard), remove numbers from array that are not 0 and 1. Thay array should now be bitwise moved with << or >> (again user choses the number of spaces moved …

Member Avatar for Stefan_2
0
288
Member Avatar for cufisa

I have been trying to fix this since two eeks and I have no clue what I am doing wrong. I have gotten the program to work so that it can tell if a number is prime or not, but the problem I am having is showing at the end …

Member Avatar for rajii93
0
414
Member Avatar for Josue198s

#include<stdio.h> int main() { int pcheck=1,i; int k=1000 for(i=2;i<k;i++) { if((k%i)== 0) { pcheck=0; break; } } if(pcheck) { printf("%d is a prime .\n",k); } else { printf("%d is not a prime.\n",k); } return 0; } this code works to check any number i that write in k but when …

Member Avatar for rajii93
0
225
Member Avatar for pittdaniweb

Hello everybody, I was asked by an interviewer the following question. but I was not able to answer. Please get back to me if you know the answer. thank you in advance. Que: What is the exact difference between the "for" loop and "while" loop in C language ?

Member Avatar for rajii93
0
814
Member Avatar for rubeea.jaffari

Hello everyone, Can someone please tell me to how to connect MS-Access database using C. Are there any drivers or libraries that I would have to download? Please specify in detail. Regards, Rubeea

Member Avatar for rubeea.jaffari
0
616
Member Avatar for priyanka raj

Would you please help me in writing a c code to read data from a file and perform 1)numeric sort, 2)alphabetical sort. the file may contain data of any kind.Like it may contain only numbers,only names or a database of employees of a company.(which contains their employee id,name,designation and salary,....in …

Member Avatar for aaaymen
1
7K
Member Avatar for steven8579

I'm having a problem with my linked list. I want to add to the beginning of the list and delete from the beginning of the list. I get an AccessViolation which is coming from where I print out the list. I also don't think it's adding elements to the linked …

Member Avatar for Ancient Dragon
0
230
Member Avatar for COKEDUDE

Here is my code that is doing the printing that gets messed up. The output is fine when you display it to your screen (terminal). Unfortunately when you redirect it to a text file it gets messed up. It displays the null characters (^@) and Enquiry characters (^E). I have …

Member Avatar for L7Sqr
0
187
Member Avatar for Kopals

I write the program in maximized screen. But my output screen is so big that I cannot see the output. The lines in which output is shown are out of the screen. When I exit TurboC, then only I can see the output as the screen is in restore down …

Member Avatar for Kopals
0
135
Member Avatar for izzytoots

So I am working on a simple assignment for my C class that reads a formatted file and prints information about the file based on the format. The file format looks like this: #Domain Alexa Rank Site Name #------------ ----- ------- --------- amazon.com 13 1177136 Amazon.com google.com 1 4533883 Google …

Member Avatar for izzytoots
0
194
Member Avatar for naveen1993

this program is working fine.. As i was moving the object with the help of ASCII values. But i want to move the object towards right as per my input (through keyboard,right arrow). But it is moving with the same x and y axis..

Member Avatar for naveen1993
0
99
Member Avatar for ravi_14

![6b87dfe9bac7df6c309f7266d28a4ad0](/attachments/small/4/6b87dfe9bac7df6c309f7266d28a4ad0.JPG "align-left") i am reading "pointers in c by naveen toppo" .According to him program crashes when it encounter int y=*ptr; i dont understand why it should crash?i think its correct. *ptr gives int value. please refer attachement.

Member Avatar for Ancient Dragon
0
169
Member Avatar for limitx3m

I've been assigned in my class to do this exact same problem: <snip> I'm wondering on how to get started. Any help would be appreciated. I know how to use the functions for c-strings, but I'm not sure if I should place all the contents of the paragraph into one …

Member Avatar for Ancient Dragon
0
294
Member Avatar for zegarnek

Hi, I do not think this is a problem as such but an interesting behaviour to watch. I have little piece of C (to do with trying later Unicode, Polish characters and text files). I was trying to find a position of a Polish character in the alphabet string. Had …

Member Avatar for zegarnek
0
426
Member Avatar for johans22

how to do this in C: if got: myheader.h: #define sz 5 in program if option = 2, sz for marray change to 10. extern unsigned char marray[arrsz]; also, in C file, locations[] be the first one if option = 1 or be locations[] be the second one if the …

Member Avatar for David W
0
222
Member Avatar for COKEDUDE

Is there a good way to slow down program output? usleep and nanosleep don't slow it down enough, delay doesn't work, and sleep keeps freezing my program. I am using Linux since I think this makes a difference in what I have to use.

Member Avatar for COKEDUDE
0
322
Member Avatar for JOHN-shirley

i need to Design and write a program to count the number of occurrences of each of the characters ‘A’ to ‘Z’, ‘a’ to ‘z’ and ‘0’ to ‘9 entered through stdin. i was thinking of defining a struc for char lower char upper and int digit but then how …

Member Avatar for David W
0
232
Member Avatar for nitin1

Actually, I am working on a project. I want to extract all the reviews from a website which has reviews related to movies, for example. I want to make an automated system which can extract the content of the website and save it to a file. That will be my …

Member Avatar for Suzie999
0
128
Member Avatar for Raghu Dev

can anyone help me in making a c program for displaying the grades(A(>60),B(45>b<60),C(30>c<45),F(fail)) of students in the form of histograms and for each grade calculation and histogram we need to use pthreads!!! so that it satisfies parallel processing!!

Member Avatar for Edward_3
0
150
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
815
Member Avatar for Tariq Amin

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

Member Avatar for Ancient Dragon
0
167
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
115
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
213
Member Avatar for Sai Ravi Teja
Member Avatar for Ancient Dragon
0
127
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
296
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
210
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
316
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
276
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
132
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
397
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
148
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
194
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
326
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
132
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
133
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
563
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
179
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
179
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
327
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
174
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
108
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
228
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
169
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
116
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
249

The End.