15,552 Topics

Member Avatar for
Member Avatar for ohblahitsme

Hello. I've been working on this program that reads input from the user and attempts to put it in a file called profile.txt I've got it to work (I checked this by making it output the file to the terminal), and from what I can tell, it does create the …

Member Avatar for ohblahitsme
0
170
Member Avatar for withinboy

[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 …

Member Avatar for sharathg.satya
0
282
Member Avatar for Nevicar

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 …

Member Avatar for frogboy77
0
225
Member Avatar for ram619

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]

Member Avatar for ram619
0
116
Member Avatar for Gaiety

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 …

Member Avatar for Gaiety
0
178
Member Avatar for jaymayne

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]) { …

Member Avatar for zeroliken
0
255
Member Avatar for shaunchu

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 …

Member Avatar for shaunchu
0
174
Member Avatar for ram619

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 …

Member Avatar for ram619
0
209
Member Avatar for Fixxxer

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 …

Member Avatar for VernonDozier
0
120
Member Avatar for mrprassad

[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.

Member Avatar for gusano79
0
88
Member Avatar for DJSAN10

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 …

Member Avatar for DJSAN10
0
140
Member Avatar for arold10

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 …

Member Avatar for zeroliken
0
151
Member Avatar for Mxous

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 …

Member Avatar for Mxous
0
134
Member Avatar for Fixxxer

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 …

Member Avatar for Gaiety
0
227
Member Avatar for Gaiety

[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 …

Member Avatar for Gaiety
0
120
Member Avatar for jatinkhandelwal

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???

Member Avatar for Mouche
0
139
Member Avatar for jatinkhandelwal

i would like to check a size of data structure of a file in another file . how can i do so using fopen????

Member Avatar for L7Sqr
0
104
Member Avatar for gategold
Member Avatar for DJSAN10
0
89
Member Avatar for vtskillz

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

Member Avatar for arunsolo1984
0
5K
Member Avatar for Liuhh00

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]

Member Avatar for deceptikon
0
64
Member Avatar for cdea06

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 …

Member Avatar for WaltP
0
144
Member Avatar for John Paul Carlo
Member Avatar for Shardendu

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) …

Member Avatar for Shardendu
0
150
Member Avatar for guccimane

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, …

Member Avatar for DeanMSands3
0
140
Member Avatar for rpittala

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 …

Member Avatar for zeroliken
0
50
Member Avatar for rpittala

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); }

Member Avatar for deceptikon
0
35
Member Avatar for samidha

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 …

Member Avatar for samidha
0
174
Member Avatar for dippatel

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. …

Member Avatar for VernonDozier
0
7K
Member Avatar for dsladev

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 …

Member Avatar for dsladev
0
88
Member Avatar for Beennn

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 …

Member Avatar for Beennn
0
226

The End.