In the C programming language any .h file is a file that contains constants and/or function declarations ( but no implementations, besides inline functions ). That means that when I write #include <foo.h> at the start of my .c file, I'll have to implement all those function declarations (...
I am using MPLAB X, everything is working great when I work on examples that require smaller or no preload at all, I do not understand why that is the case, is there a limit to the TMR0L?
Hello please help asap,
my specific case I have:
4MHz crystal -----> 1 / (4MHz / 4) = 1MHz timer
I...
I have a problem there,I want to Users decide a,b,c,d,e numbers.
if I write
printf("enter numbers:");
scanf("%d",&a);
printf("enter numbers:");
scanf("%d",&b);...
if ı do like that ,it has not any problem but its not effective,Program always asking number a,b,c etc.
My wish is...
Hello!
My homework is making a crossword.
I write a code like this:
do{
//code
printf("Please enter the coordinate and the word: \n");
scanf(" %c%d %s",&row2,&column2,word2);
if(row2=='E' && word2=="xit") exit(0);
//code
}while(count2!=10);
But this is...
Hi
I would like to Derive the power spectrum of sinusoid.I tried like this. But It doesn't work.
<Moderator: CODE tags added>
#include <stdio.h>
#include <math.h>
#define pi 3.1415926535
FILE *in_file, *out_file;
int main()
{
dft();
}
int dft(int argc, char *argv[])
{
char...
Homework Statement
On a phone keypad, many of the numbers have letters associated with them. For instance, the letters A, B, and C are associated with the number 2. Write a program that accepts a number as input and prints all of the possible letter combinations associated with that number. For...
Hello everyone I am going to buy a computer soon. And because I don't have much money, computer s ram can be 4 GB at most and which will cause me some trouble. My question is that will 2gb ram be enough to work on MATLAB and learning to code.
How hard is c++ debugging compared to c?
What do you think o f the sentence:
"It s easier to shoot your foot in c. In c++ it s harder, but when you do, you blow away your whole leg"?
Is it really hard( considering the fact code isn t "context free" and it may vary from compiler to compiler, it s...
As I know each function can have no parameter this function is called void function ,for example main function, also there is some functions which has one or more parameters either input or output , the number of parameters should be specified in the function prototype and function definition...
int main(void)
{
int *ptr;
int a=1, b=2, c=3;
ptr = &a;
printf("%p\n", &ptr);
printf("%p\n", &b);
printf("%p\n", &c);
ptr = b;
printf("%p\n", ptr);
printf("%d\n", a);
system("PAUSE");
return 0;
}
ok here is the code I wrote.
ptr(the...
I have a .txt file with 100,000 integers from 1-100,000, with each integer in a newline. I am facing a problem in using the fgets function. How do I read the integers into an array?
#include <stdio.h>
//Program to count number of inversions in an input file of integers using Brute force...
Here is a part of a statement, it might be incorrect, I don't remember the exact statement. Please tell me what the double exclamation marks means and what about the double percentages.
Here is the code.
if (!(!d = %%d))
else ... ( not spot-on, don't remember)
I think...
Can you explain the working mechanism of extern keyword in C language? I have tried wiki and other sites but couldn't follow. Please explain in simple english.
I use gcc to compile the code. When I run the program, I get segmentation fault (core dumped).
ranked_galaxies.txt:
# PGC Name RA DEC Mass Distance Diameter Tile_Number Rank_stat
37617 NGC3992 179.399700 53.374450 2.290868 22.909000 5.613000 1 2.51796409431e-05
62964 IC4837A...
#include <stdio.h>
#include <stdlib.h>
int main()
{ double a[10];
int i=0;
for(i=0;i<10;i++)
a[i]=0.0;
for(i=0;i<10;i++)
printf("a[%d]=%e, "), i, a[i];}
The result is radom number. What's wrong with my code?
/*find abs value of an array*/
int absv(double *a, int n)
{
int i;
for(i=0;i<n;i++)
{if (a[i]<0)
a[i]=-a[i];
}
}
int main()
{
double a[7];
int i,j;
for(i=0;i<7;i++)
scanf("%lf\n",&a[i]);
absv(a,7);
for(j=0;j<7;j++)
printf("%e\n",a[j]);
printf("%d,%d",i,j);
}
The...
I am an student of Electrical Engineering and have already learned C language since, it is useful for programming of micro-controllers. I still want to learn some other programming language too. Please suggest me a programming language that will be useful for me for making useful softwares and...
Homework Statement
I want to compare the execution times for DDA and Bresenham's Line algorithm using a C program. I used the clock_t command; I'm getting the execution time for Bresenham’s algorithm as 0.164835 but 0 for DDA.
3. The Attempt at a Solution
clock_t start,end...
Homework Statement
1Can we perform arithmetic operations between float and int variables ,
As an example can we say a+b while a is an integer and b is a float.
2 And what function below will read NUMBER of elements from a file?
fileread( )
getline( )
readfile( )
fread( )...
i have a matrix 4x4 like this
1 5 7 3
2 6 8 0
1 4 3 2
0 4 0 5
my teacher asks me to print out 1 2 3 4
each of the digits is from the 1st 2nd 3rd 4th rows
it looks very simple, but because i just learned c for two months, i don't know how to code a program, true.
could you help me...
a "C" problem
is anybody aware of numerical methods in C language...
numerical methods include Newton-Raphson method,Euler's method,Milne's method,Newton's forward and backward implementation,Gauss divergence backward and forward interpolation.
pls help me,i will b so thankful 2 them who...
I am currently in my second quarter learning the c language. The class is not hard at all, but i want some challenge problems. Are there any goods links?