C programming Definition and 115 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
-
D
Python How does one assess progress when learning a programming language?
I'm a physics major (Junior) who would like to learn a programming language. Many suggest Python as a good starting language, so let's suppose that is the language I want to first learn. This isn't for employability or general usefulness; rather, I'm just curious. How exactly does one go about...- dpatnd
- Thread
- C programming C++ programming Language Programming Python
- Replies: 8
- Forum: Programming and Computer Science
-
Other Should I Learn C Programming from an Old Book?
My dad gave me his old copy of "the c programming language" by Kernighan and Ritchie, but I was flicking through it and it comes across as quite old-fashioned and has a lot of random sh*t like pointer arithmetic, memory allocation etc. Being an idiot, and one who's pretty out of practice with...- ergospherical
- Thread
- C programming Programming
- Replies: 16
- Forum: Science and Math Textbooks
-
I
Comp Sci Searching Array for an Element using Linear Search
I write a Linear Search code,then ı decided ask to user "r" and "int arr".I mean,User decide their r and arr numbers.I tried scanf("%d",r); command but doesn't work This code my first code before the decide Ask user : #include <stdio.h> int search(int arr[], int n, int r) { int i; for...- iquicck
- Thread
- Array C programming Computer science Element Linear Search
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
Good C programming introduction on Coursera, starts Feb 5
If you're looking to get a serious but entertaining introduction to computer programming, I wholeheartedly recommend Anne, Andrew, and Genevieve's course, "Programming Fundamentals". https://www.coursera.org/learn/programming-fundamentals I know one of the instructors from my days at Penn, and...- harborsparrow
- Thread
- C programming Introduction Programming
- Replies: 3
- Forum: Programming and Computer Science
-
D
Starting a C program with a command
Homework Statement Analyze the code below and figure out what it outputs if it's started with this command: The correct solution is given so i can better understand the parts of the problem. Homework Equations 3. The Attempt at a Solution [/B] I had typed it out and tried to get the same...- diredragon
- Thread
- C programming Program Programming
- Replies: 10
- Forum: Engineering and Comp Sci Homework Help
-
D
What is the output of this C program with int pointers?
Homework Statement I am supposed to analyze the code and find it's output without running it. Some things were unclear so i did run it and i have some things that puzzle me. Homework Equations 3. The Attempt at a Solution [/B] #include <stdio.h> #include <stdlib.h> #include <string.h> enum e...- diredragon
- Thread
- C programming Pointers Program
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
D
Which code segment completes this C code?
Homework Statement This is a question from the test i had today in which we had to look at certain C code segments and deduce which code part is missing in order for the program to do what we desire. Part b) was a short questionnaire to test our knowledge about c types and declarations. Part a)...- diredragon
- Thread
- C code C programming Code Homework
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
D
Assistance needed writing a C program
Homework Statement My task is to write a program that reads from the .txt file into a list which contains two parts, the part of the text from the file and a pointer to the next element. Here are the specifications of the problem: When reading from the file you should separate the letters from...- diredragon
- Thread
- Assistance C programming Homework Program Writing
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
How to dynamically allocate an array of strings
I was supposed to write a program that has a while loop in which two people, person1 and person2 input a string. The program runs the loop until one of the people inputs "it's over". At that time the program should exit and print out the correspodance between these two people while they were in...- doktorwho
- Thread
- Array C programming Coding Strings
- Replies: 6
- Forum: Programming and Computer Science
-
Help with pointers and strings in C
Homework Statement I have to create a program that dynamically allocates a string and uses up no extra space (The string takes up as much space as it needs to),checks if entered string is 'please stop this', if it is then the prgogram exits and if it isn't then it continues, it makes a copy of...- doktorwho
- Thread
- C programming Pointers Program Strings
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
Kernighan vs Deitel: Which C Programming Book Is Best for You?
https://www.amazon.com/dp/0131103628/?tag=pfamazon01-20 https://www.amazon.com/dp/0133976890/?tag=pfamazon01-20 These two books are recommended by my school's C programming course and i can't decide which to buy. I have a big test in about a month in which i will have 2 hours to write 3...- doktorwho
- Thread
- Books C programming
- Replies: 8
- Forum: Programming and Computer Science
-
Help writing a program (crossword puzzle)
Homework Statement I am supposed to write a program in C that does the following: It creates a 2d array from your specifications and as inputs takes only letters 'a' to 'z', 'A' to 'Z' and '*' and nothing else. It should immediately exit if something else is inputed. This array represents a...- doktorwho
- Thread
- C programming Program Puzzle Writing
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
Question about limiting inputs in C
I want to write a program that in the twodimensional array stores only capital and noncapital letters of the alphabet and the sign #. Everything else inputted cannot be stored in the array. How am i to do this in the easiest way? I can think of only checking for each input if it exists in some...- doktorwho
- Thread
- Array C programming Input Output
- Replies: 5
- Forum: Programming and Computer Science
-
V
Why does not this Erdos-Renyi C code work?
Homework Statement I need to write an Erdos-Renyi random graph, by using the adjacency matrix (or alternatively list) and calculate the fitness of the graph. Definition: G(n, p) is a random graph with n vertices where each possible edge has probability p of existing.Homework Equations The...- valesdn
- Thread
- Algorithm C code C programming Code Graph Modelling Work
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
Review C Code: Find & Resolve Issues in Visual Studio & repl.it
Hi, i wrote a code and annotated it but i have few problems with it. First it won't run on Visual Studio but it runs fine on repl.it online site which uses a C ide. Second, it seems wrong when i input 5 45 6 -4 8 3 It should print out 8 3 but for some reason it misses out on 3. Could you see...- doktorwho
- Thread
- C code C programming Code Programming
- Replies: 47
- Forum: Programming and Computer Science
-
Help w/ C Programming Homework - Create Array & Print All Inputs
Homework Statement I am fairly new to C programming. I need to write a code that creates an array of max 300 numbers, ask the user to input the numbers and then print that array. Homework Equations 3. The Attempt at a Solution [/B] Here is my code #include <stdio.h> void main() { int...- doktorwho
- Thread
- Array C code C programming Code Coding
- Replies: 9
- Forum: Engineering and Comp Sci Homework Help
-
A C program to determine the most common birthday
Homework Statement Write a program that opens a file of the users choice that contains a list of birthdays. Extract from this file two things: (1) the date with the most common birthday (all of them) and (2) the month with the most people born. We will not test for a tie in either of these...- toforfiltum
- Thread
- C programming Program
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
Simple C program involving arrays which cannot execute
< Mentor Note -- thread moved to HH from the technical Computer forum, so no HH Template is shown >[/color] I have a homework problem which requires me to convert a word a user entered to Pig Latin by moving the first letter of the word to the end and adding an ay to it. For example, Tuesday...- toforfiltum
- Thread
- Arrays C programming Program
- Replies: 21
- Forum: Engineering and Comp Sci Homework Help
-
Learn C: Best Book for Beginner & Harvard Intro to Programming
Hear me out on this. I am an absolute beginner to C, i know some Python and i just finihed a month course on Pascal (school currciulum) and we're starting C by the end of February. Even though I am a beginner I am a fast learner and i want a book that is escalating moderatly or even fast. Also...- doktorwho
- Thread
- Book C programming Programming Self-study Textbook
- Replies: 21
- Forum: Science and Math Textbooks
-
K
How to involve system features in C programming?
How to involve system functions like notifications, alert, and somewhat like that in C program?- Kp Patel
- Thread
- C programming Programming System
- Replies: 3
- Forum: Programming and Computer Science
-
N
C/C++ How to read a list of USB from C++ in ubuntu OS?
I am trying to use C++ (eclipse in Ubuntu OS) to read USB connection. Usually, on the terminal window, I can use command "lsusb" to see the list. Now, I want to do the same way with C++. can anyone help? Thank you very much.- Nate Duong
- Thread
- C programming C++ C++ programming List Os Ubuntu Usb
- Replies: 3
- Forum: Programming and Computer Science
-
Electronics Building an Alarm Clock with Basic C Programming Skills
I'd like to build my own reliable alarm clock, but I don't have any knowledge in electronics and no fancy equipment, only some humble C programming experience. What do I need and what do I need to know to build one myself. Thanks very much.- pioneerboy
- Thread
- Building C programming Clock Diy project Electronics Programming Skills
- Replies: 5
- Forum: DIY Projects
-
A
Help in telling compiler to include header files for C
For a program to use I have to compile some .c files which include #include''header.h'' statements and I have tried different commands to compile but it gives me errors like 'No such file or directory'. Here is start of my file named #include "einterp.h" while start of file looks like this...- Atr cheema
- Thread
- C programming Compiler files Gcc
- Replies: 27
- Forum: Programming and Computer Science
-
J
MHB Compound Interest C programming problem
Hello everyone, i hate that i can't figure this out and I'm just looking for good direction on how to figure out the last bit of my code. I'm first time user of C programming and haven't fully grasp the concepts and tools available to me so be patient if you offer any help. My task is to write a...- jasonsmith206
- Thread
- C programming Compound interest Interest Programming
- Replies: 5
- Forum: Programming and Computer Science
-
C programming, where did I get it wrong please
Edited by mentor to include image inline Hello Please I am practicing my simple basic C Programming using Notepad++ and Cygwin64 I have written tried running the codes in the picture below, it doesn't detect any error when I run it but when I try to 'withdraw some money less Tha the fBalance...- Simon Clement
- Thread
- C programming Programming
- Replies: 6
- Forum: Engineering and Comp Sci Homework Help
-
U
C data structures and algorithms - graph problem
Homework Statement Given connected, directed and weighted (positive weights) graph. Find the shortest cyclic path for each vertex. Cycles have back edges and can also be self loops. 2. The attempt at a solution I need some clarifications for this problem related to implementation in C. After...- username_unknown
- Thread
- Algorithms C programming Data Graph Structures
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
U
C - Degree of a directed unweighted graph
Homework Statement Given the representation of directed unweighted graph: typedef struct { int n;//num. of vertices void *info[MAX];//information of vertices int am[MAX][MAX];//adjacency matrix }GRAPH; Write a function int minDegree(GRAPH*); and int maxDegree(GRAPH*); that return the...- username_unknown
- Thread
- C programming Degree Graph Graph theory
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
G
C: Stack with binary search trees
Homework Statement Create a linear stack with N binary search trees (data of a tree node is an integer). Read N trees, push them on the stack. Then, empty the stack and store trees in the new array and print the content of the stack. 2. The attempt at a solution The following code gives...- gruba
- Thread
- Binary C programming Search Trees
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
G
C: Printing unsigned char data type
Homework Statement Given a matrix n x m with unsigned char data type entries (entries are of size 1 byte, so data type of an entry should be unsigned or signed char, not int or char *). Entries are read in hexadecimal format (0x00,0x11,0xFF,...). Matrix should be allocated dynamically. Print...- gruba
- Thread
- C programming Data Printing Type
- Replies: 1
- Forum: Engineering and Comp Sci Homework Help
-
F
About only one function (C programming)
I have learned that in c programming language at least one function is needed. And the function is given as: int main(){ //statements; return 0; } Then when I turned to the function page (in a web tutorial) I saw functions are declared by return type-function name and parameters. The...- fireflies
- Thread
- C programming Function Programming
- Replies: 28
- Forum: Programming and Computer Science
-
S
Need help with accelerometer data processing
Hi, am working on a vehicle tracking device, i am using LIS3Dh accelerometer to get the acceleration data. i am using TM4c1231e6pz controller. I need to implement a harsh breaking alert, I am having difficulty in finding out which direction the vehicle is moving since the axis are not aligned...- Shyam Krishnan
- Thread
- Accelaration Accelerometer C programming Data Orientation Processing
- Replies: 7
- Forum: Programming and Computer Science
-
G
C program -- need an explanation
Homework Statement I need help with the following problem in C programming language: Define a quiz and add two questions in it with given possible answers. Display the questions one by one and allow the user to choose between 1, 2 or 3 (numbers that represent serial numbers of possible...- gruba
- Thread
- C programming Explanation Program
- Replies: 6
- Forum: Engineering and Comp Sci Homework Help
-
S
Learn C Programming Language: Tips & Resources
Hi all, I am looking to learn C by myself since it is a programming language that is used in my micro controllers class that i am going to take during the upcoming Spring semester at my university. I was wondering how i should go about doing this? I was thinking of using book The C Programming...- sanhuy
- Thread
- C programming C++ Self study
- Replies: 9
- Forum: Programming and Computer Science
-
Looping problem in C programming
I know about For loops but i don't know how to solve a problem like this: A program in which a user wants to print a number for specific number of times but this is not initialized i mean user inputs it after the program is compiled?- Dave Ritche
- Thread
- C programming Programming
- Replies: 14
- Forum: Programming and Computer Science
-
G
C: Store The Content Of Linked List Into BST
Homework Statement The following program should create singly circular linked list which has n arbitrary stored positive integer numbers. Then, create BST which has all primes from the list, and store them in text file in descending order. Homework Equations Linked list Binary search tree File...- gruba
- Thread
- C programming List
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
C Programming: Arrays and pointers
Homework Statement So I created two arrays one called departure_time and the other arrival_time and populate each array as follows. I've tried both putting 8 and defining N as 8 int departure_times[N]={480, 538, 679, 767, 840, 945, 1140, 1305}; int arrival_times[N]={616, 712, 811, 900, 968...- SnakeDoc
- Thread
- Arrays C programming Pointers Programming
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
G
How Can You Delete a Record from a Text File Using a Struct Field?
Homework Statement How to delete specific record from a text file by some field from struct? Homework Equations -File handling -Searching algorithms The Attempt at a Solution I know that one of the searching algorithms is needed, but could someone explain how to delete found record from file?- gruba
- Thread
- C programming File
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
G
Other C: Data structures and algorithms books of solved problems
What books of solved problems (free in pdf) would you recommend for data structures and algorithms in C (linked lists, trees, sorting and searching algorithms, graphs, recursion, files)? Note: I am not looking for theoretical books, but books of solved problems. Thanks for replies.- gruba
- Thread
- Algorithms Books C programming Data Structures
- Replies: 1
- Forum: Science and Math Textbooks
-
A
C Programming - First assignment not sure how to approach
Homework Statement Hi, I am currently in a C programming course and i have no background knowledge of programming whatsoever. The professor in my course isn't very good at explaining so I'm a bit lost here. (Please keep in mind, I am NOT asking anyone to do this for me. I would like to know a...- Arnoldjavs3
- Thread
- Approach Assignment C programming Programming
- Replies: 10
- Forum: Engineering and Comp Sci Homework Help
-
G
Dynamic allocation problem with linked lists
Homework Statement I need to create data structure which contains three linked lists that are connected to one root node. Homework Equations -Data structuresThe Attempt at a Solution I can't find what is wrong with the following code: #include<stdio.h> #include<stdlib.h> typedef struct node {...- gruba
- Thread
- C programming Dynamic
- Replies: 3
- Forum: Engineering and Comp Sci Homework Help
-
S
Python Good problems and exercises in C, Python, Ruby and Scala
I have previously learned C and Python. I'm just starting out with Ruby and Scala. But I need to become more proficient in these languages, so could someone suggest good sources of problems/exercises in each of these languages sources could include websites, books, etc.- sarvesh0303
- Thread
- C programming Exercises Programming Python Ruby
- Replies: 1
- Forum: Programming and Computer Science
-
C
How Does the GET_UINT32 Macro Convert Input into Hexadecimal Format?
Homework Statement this is in my function GET_UINT32( X, input, 0 ); this is a macro #define GET_UINT32(n,b,i) \ { \ (n) = ( (uint32) (b)[(i) ] << 24 ) \ | ( (uint32) (b)[(i) + 1] << 16 ) \ | ( (uint32) (b)[(i) + 2] << 8 ) \ | ( (uint32) (b)[(i) + 3] ); \ } 3435973836=0xcccccccc when inputted...- cutesteph
- Thread
- C programming Programming
- Replies: 2
- Forum: Engineering and Comp Sci Homework Help
-
N
Could someone give me a basic lesson/project to do in C
I know there are many resources online for this but I'd to learn from someone on here. Could you provide me a lesson/project to do and finish in C language for beginners. I can get the software needed to compile and such and will post an image when I am done or provide whatever proof of...- Niaboc67
- Thread
- C programming
- Replies: 8
- Forum: Programming and Computer Science
-
G
Trick-or-Treat (Halloween C programming)
Homework Statement Trick Or Treat Halloween is round the corner and it's time for trick-or-treating. You reside at the top left corner of a n-by-n town map and heading to the halloween party located at the bottom right corner. While on your trip, you decide to visit a minimal number of houses...- galaxy_twirl
- Thread
- C programming Programming
- Replies: 6
- Forum: Engineering and Comp Sci Homework Help
-
G
Winning Lines for Tic-Tac-Toe (C programming)
The Question Winning Lines Tic-tac-toe is a game played by two players o and x. A player wins when he/she succeeds in placing three respective marks in a horizontal, vertical or diagonal row. Given a 3-by-3 tic-tac-toe board, a winning line is a line (row, column or diagonal) that is not...- galaxy_twirl
- Thread
- Arrays C programming Lines Programming
- Replies: 5
- Forum: Engineering and Comp Sci Homework Help
-
G
Implementing strcat without string.h in C
Hi everyone. This is similar to my strcpy question previously. I tried to code but when I ran the code, a segmentation fault appears. I think this has something to do with my loop for the array but I have problems resolving it. May I have some help please? Thank you. My codes and the original...- galaxy_twirl
- Thread
- c programming functions homework pointers strings
- Replies: 24
- Forum: Engineering and Comp Sci Homework Help
-
G
Implementing strcpy without <string.h>
Hi everyone. I ran into a problem while trying to code the string function, strcpy, without the use of <string.h>. The function, strcpy, which I have to make myself is exactly the same as the strcpy in <string.h>.The question in my homework is: Implement the my_strcpy(s1,s2) function that...- galaxy_twirl
- Thread
- c programming coding functions strings
- Replies: 21
- Forum: Engineering and Comp Sci Homework Help
-
D
Can Anyone Help with Simple C Programming in Ax=B Homework?
Homework Statement #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { int i,j,k,n; float A[3][3]={{3,0,6},{4,1,3},{6,3,0}}; float U1[3][4]={{3,0,6,0},{4,1,3,0},{6,3,0,0}}; float U2[3][4]={{3,0,6,0},{4,1,3,0},{6,3,0,0}}; float...- darwinharianto
- Thread
- C programming Programming
- Replies: 4
- Forum: Engineering and Comp Sci Homework Help
-
D
Simple C programming for gaussian
Homework Statement make a gaussian elimination in C the one we used on matrix to find x1 x2 and x3 if the matrix is 3x3 Homework EquationsThe Attempt at a Solution #include <stdio.h> #include <stdlib.h> #include <math.h> int main() { int i,j,k,n; float...- darwinharianto
- Thread
- C programming Gaussian Programming
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help