15,551 Topics
| |
[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> void addToStart(); void addToEnd(); void printList(); void removeNodeAt(); void createList(); void menu(); int option; struct node { char cName [50]; int cNumber; char tDescrip [50]; struct node *next; }*newnode, *display, *temp, *list, *prev, *head, *tail; main() { do { menu(); switch (option) { case … | |
Hi everyone, I haven't really found much here on how to input into functions and I'm looking for more information on it. Basically my problem is this: I have to make a function that calculates feet into yards, and I'm trying to find out how to make it so I … | |
The output is 2011. Can anyone plz tell me how it is so ????[CODE=c]#include<stdio.h> #include<conio.h> void main() { char c[]="GATE2011"; char *p=c; clrscr(); printf("%s",p+p[3]-p[1]); getch(); }[/CODE] | |
I have created few files and Makefile in the same place. I have read in below link about the special variables $@ and $< and used as so. [URL="http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/"]http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/[/URL] but when the say make i keep getting the error [ICODE]gcc -o calc *.o /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/../../../crt1.o: In function `_start': (.text+0x18): undefined reference … | |
Need help making a module that sorts 4 arrays this how it started out void dataSort (float sLengthArray[],float rSlopeArray[],float speedArray[], float size) { void swap (int *x,int *y); int pass,j; for (pass=0;pass < size-1; pass++) { for (a = 0;j< size-1; j++) { if (slengthArray[j] > slengthArray[j + 1]) { … | |
So, I'm doing a test of strtok and my csv reader to fill an array of structs. Each line in the csv has a bunch of country information, and I'm only pulling the 2nd, 3rd, 8th, and 9th fields in each line to make the structs. My biggest problem at … | |
The output of this code is "hhe!". Upto "hhe" I can figure out what is happening but, where does this "!" came from? ASCII value of "!" is 33 and here I don't think we are anyhow getting this value. Thanks in advance[CODE=c]#include<stdio.h> #include<conio.h> void main() { static char s[25]="The … | |
Hi There. I'm trying to fit a function Acos(wt + theta) to my data that I have binned and need to find the best values for the variable parameters A, w and theta so that the cos function fits to my data. However I've tried making a loop for this … | |
[CODE] struct abc{ char a; char b; char c; }; [/CODE] what is sizeof (struct abc) in gcc ? it is giving 3, why not 4 bytes. | |
I am reading Kernighan and Ritchie, and honestly, I am not able to understand anything in the following sentence I encountered while reading: [B]Any integer is converted to a given unsigned type by finding the smallest non-negative value that is congruent to that integer, modulo one more than the largest … | |
I am writing this program about Gas mileage, In the program I am assigning a value that is -1 as a sentinel value, that's why I use the While loop. The problem is I can input [B]gallon[/B] variable, but the miles variable keep repeating over and over again. My question … | |
I need to write a code that takes a percentage and converts it into a letter grade. The problem is that I'm not allowed to use if statements. 85-100 -> A 75-84 -> B 65-74 -> C 55-64 -> D 0-54 -> F One attempt I made was changing the … | |
Hi there I have written the following code to read some data from a file and bin the data into bins of equal size so I can plot this data easily. [CODE]#include <stdio.h> #define N_HITS 1800 #define N_TIME_BINS 78 int main() { int i, time_bins[N_TIME_BINS],j; double event; double hit[N_HITS],value; FILE … | |
[CODE] #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main( void ) { int fd,nob; char str[1024]; fd = open("test.txt",O_RDWR|O_CREAT,S_IRWXU); if (fd < 0) { perror("open:"); exit(0); } nob = write(fd,"hello first",1024); close(fd); printf(" %d nob written",nob); fd = open("test.txt",O_RDWR); nob = read(fd,str,1024); close(fd); printf(" %d nob … | |
hey i want to access a variable value in another file .(without usage of extern and separate header file) . can i do it using fscanf ?? if so then how??? | |
i would like to check a size of data structure of a file in another file . how can i do so using fopen???? | |
:S hello everybody. I don't know differentiation of C,C++, C#. Can you help me? | |
Hi, I was wonder if someone could give me some help with my program I have a variable: char *insert = "abcdefgh" and i want to split that into chars like so, 'a', 'b', 'c', 'd', etc. I've tried ToCharArray(), but that doesnt seem to work | |
Hey everyone, i am just wondering how do i convert a string to just lowercase so it isn't case sensitive without using the loop method; [CODE]for(i=0; str[i]; i++) str[i]= tolower(str[i]);[/CODE] | |
So I was asked to write a code which would take in 2 dates of the format mm/dd/yyyy, validate that they were good dates (including leap years), then output the dates in chronological order. It works as intended for every date I throw at it but it seems way to … | |
please help me to this one | |
Plz help me out with this : This is saved as myfuncs.c [CODE]int factorial(int num) { int i, f = 1; for(i = 1; i <= num; i++) f = f*i; return(f); } int prime(int num) { int i; for(i = 2; i < num; i++) { if(num%i == 0) … | |
I am learning tutorials online about http client programming using Linux. I found these 2 sample programs, but I am kind of confused on what command line arguments are suppose to be passed to it. I think for program 1, string [1] should be the IP address of the url, … | |
Hi All, If I have 10 numbers in my brain and I have taken 9 numbers out of my brain except one number.what is that number(remaining number) ? and write a program for that. (or) I have 10 bolls numbering 1,2,...10 in a bag and I have taken 9 bolls … | |
I know about the answer but expecting some more points and examples other than what I know #include<stdio.h> #include<stdlib.h> void double_fun(int **q) { *q=malloc(10); **q=10; } int main() { int *p; double_fun(&p); printf("%d \n",*p); } | |
Here is a code for assembler; in which every-thing is gonna run except Origin directive.. [code] #include<stdio.h> #include<string.h> #include<conio.h> struct mottab //declaring mot table structure { char mn[6]; int Class; char opcode[3]; }; struct symtab //declaring structure for symbol table { char symbol[8]; int address; int size; }st[20]; struct littab … | |
hi im told to make a program where the user enters a large number like 13195 and the prgrams gives it the highest prime factor, which i 29. now i have to do this using recursion in basic c, without using loops of any kind, so noo for, while etc. … | |
Hi everyone, I'm new at C (just started this week), and I'm reading tutorials on line without the help of a book or class. I was wondering if there are common practices most tutorials teach that really aren't good to get into. The tutorial I'm reading now says to use … | |
First off im sorry if this is the wrong place to be asking. Im looking for some advice on where I should start, heres some background information on my experience. Iv been software developing for several years now working with websites, computer applications and computer games and have an understanding … | |
im solving a problem in linked list.how to check loop inside a linked list. i ve done implentation. always it goes without any error. but sometimes it encounters segmentation error. i dont find wny error or warning other than that.please try to help me figure out [CODE] #include<stdio.h> #include<stdlib.h> #include<string.h> … |
The End.