15,540 Topics

Member Avatar for
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
139
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
132
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
216
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
118
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
138
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
88
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
143
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
148
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
137
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
173
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
87
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
Member Avatar for dineshswamy

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

Member Avatar for zeroliken
0
133
Member Avatar for shuchi0113

int main(){ int near * ptr=( int *)0XFFFF; ptr++; ptr++; printf(ā€œ%pā€,ptr); return 0; } Output:0003 why the op is 3 and how to convert 0XFFFF into its decimal equivalent?

Member Avatar for shuchi0113
0
581
Member Avatar for vincenzorm117

I have been having trouble developing a function that frees all of the memory associated with structs of a linked list. Im not asking for a clear cut answer, just an idea or a function that can aid. F.Y.I. the linked list contains a head struct and a tail struct …

Member Avatar for sorry711
0
236
Member Avatar for marirs07

Hi all, I would like to call a makefile with a particular variable and value so that the variable is used to make decisions inside the makefile. Thanks

Member Avatar for dmanw100
0
195
Member Avatar for themenucha

Hi!!! I'm trying to pass 2d array to function and i can't. In general i'm trying to print chess board in action. The board is an integer.I need a function that gets 2d array in specific place and returns correlatedm char. const int pawn = 1; const int rook = …

Member Avatar for themenucha
0
348
Member Avatar for Momiji Sohma

Hi,I want to write a program that calculate the increment and new salary of employee based on the average of three evaluation points.(using pass by reference/pass by value). I've done the coding but the output is wrong. I think there's a mistake on the call function. #include<stdio.h> float get_increment(float *a); …

Member Avatar for zeroliken
0
111
Member Avatar for cdea06

What i'm trying to do is use a loop that prompts the user to re-enter a new string of numbers if what he previously entered is not within the specified range of 1-16. What I have is not working as expected. What am I doing wrong? [CODE] /* Program assignment …

Member Avatar for WaltP
0
260
Member Avatar for jeffw362

I'm writing a program that takes records(first and last name,id and mark), reads them from a file and inserts the information in StudentRecord structures. For some reason,when I go to list the information, the first and last name strings in each structures are all the same. The first and last …

Member Avatar for nezachem
0
232

The End.