C language Definition and 27 Threads
-
C
Why declarations in <stdio.h> aren't implemented?
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 (...- CGandC
- Thread
- C language C programming
- Replies: 2
- Forum: Programming and Computer Science
-
M
Comp Sci Interrupts on pic18f452 not shooting in mplab X, help? C language
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...- Maniac_XOX
- Thread
- C language Coding Computational Engineering Language Mechatronics Microcontroller Physics
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
I
Comp Sci C language "too many arguments for format" error
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...- iquicck
- Thread
- C language Error Format Language
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
A
Comp Sci Do-while loop-> exit not working (making a crossword puzzle)
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...- anonim
- Thread
- C code C language Loop Puzzle
- Replies: 21
- Forum: Engineering and Comp Sci Homework Help
-
Engineering The power spectrum of a sine wave (C language)
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...- arcTomato
- Thread
- C language Language Power Power spectrum Sine Sine wave Spectrum Wave
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
Program to display letter combinations on phone keypad
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...- toforfiltum
- Thread
- C language Combinations Program
- Replies: 12
- Forum: Engineering and Comp Sci Homework Help
-
C/C++ C++ Stack and Queue Tutorial for Beginners
is there any tutorial which covers stack and queue in c++. i am not able to understand it is getting difficult for me .- sukalp
- Thread
- C language C++ C++ programming Tutorial
- Replies: 10
- Forum: Programming and Computer Science
-
C
MATLAB Is 2GB ram enough to work on C language and matlab
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.- Caglar Yildiz
- Thread
- C language Language Matlab Ram Work
- Replies: 16
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
C/C++ C++ vs C Debugging: How Hard Is It?
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...- Domenico94
- Thread
- c language c++ debugging programming
- Replies: 3
- Forum: Programming and Computer Science
-
MHB What are the parameters for the printf function in the C language?
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...- Maged Saeed
- Thread
- C language Language Parameter
- Replies: 2
- Forum: Programming and Computer Science
-
K
Why Does Changing Pointer Assignments in C Affect Variable Values?
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...- kidsasd987
- Thread
- C language Language
- Replies: 7
- Forum: Programming and Computer Science
-
N
C language: I cannot find the output file.
What is wrong with my code? #include <stdio.h>int main(int argc, char *argv[]) { int i=0; FILE *fp; char fname[100]; sprintf(fname,"%04X.txt",i); fp=fopen("fname", "w"); fprintf(fp, "hello world!\n"); fclose(fp); }- nenyan
- Thread
- C language File Language Output
- Replies: 4
- Forum: Programming and Computer Science
-
Z
Reading .txt files to an array in C language
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...- zorro
- Thread
- Array C language files Language Reading
- Replies: 11
- Forum: Programming and Computer Science
-
Is it a valid statement - C language?
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. [SIZE="4"]if (!(!d = %%d)) else ... ( not spot-on, don't remember)...- pairofstrings
- Thread
- C language Language
- Replies: 25
- Forum: Programming and Computer Science
-
How Does the Extern Keyword Work in C Language?
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.- pairofstrings
- Thread
- C language Language
- Replies: 3
- Forum: Programming and Computer Science
-
N
C language: reading a txt file and segment fault
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...- nenyan
- Thread
- C language Fault File Language Reading
- Replies: 6
- Forum: Programming and Computer Science
-
N
A little question about c language
#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?- nenyan
- Thread
- C language Language
- Replies: 3
- Forum: Programming and Computer Science
-
N
A little question about c language
/*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... -
M
How can I fix syntax errors in my C code?
Hi all, I am learning C language in S-Function Simulink does anyone prgram in C? I need help please Thanks- mbolhi
- Thread
- C language Language
- Replies: 5
- Forum: Programming and Computer Science
-
D
Electrical Engineering and have already learnt C language
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...- Danish_Khatri
- Thread
- C language Electrical Electrical engineering Engineering Language
- Replies: 1
- Forum: Programming and Computer Science
-
V
Compare execution time in C language
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...- Vagrant
- Thread
- C language Compare Language Time
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
H
Q: how variable declaration & initializing in C Language.
hi please tell me how variable declaration & initializing in C Language..whit examples..- hafiz16
- Thread
- C language Language Variable
- Replies: 10
- Forum: Programming and Computer Science
-
R
C Language Problem: Arithmetic & Fileread() Function
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( )...- rclakmal
- Thread
- C language Language
- Replies: 13
- Forum: Engineering and Comp Sci Homework Help
-
K
What is the impact of using the void keyword before the main function in C?
What is the effect of putting void before main function i mean? void main() { } void main(void) { }- kthouz
- Thread
- C language Functions Language
- Replies: 4
- Forum: Programming and Computer Science
-
P
Matrix operations in C language
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...- phillosopher
- Thread
- C language Language Matrix Operations
- Replies: 4
- Forum: Programming and Computer Science
-
Y
Coding Help: Numerical Methods in C Language
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...- yamini
- Thread
- C language Coding Language Numerical Numerical methods
- Replies: 3
- Forum: Programming and Computer Science
-
K
Any good programming challenge using the c language.
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?- kant
- Thread
- C language Challenge Language Programming
- Replies: 12
- Forum: Programming and Computer Science