15,551 Topics
| |
hello Can anybody tell me how to Write a C program to print "Hello World" with out using ';' | |
Hello, C newbie here... below is a driver for a pretty simple function which is supposed to read in n chars from input and store in a char array. [CODE=C]#include <stdio.h> #define SIZE 81 void get_str (char * array, int n) ; int main (void) { char instr [SIZE] ; … | |
hi im a very fresh n new user of this field... wanna know how to simulate different type of possilbilities of combinmation of number from a set of numbers and characters example.. given that to create all comnination that can be formed from the set ABC123 like combination ...? thanks … | |
Hi all, I'm trying to figure out how I can call the function estimate from the main. It takes as input: [code=c] float data[], int n, int m; [/code] and should output the float *xms and the float array float d[]: [code=c] float *xms, float d[] [/code] I don't know … | |
I cant seem to figure out whats wrong with this code, I am trying to generate random floating point number numbers with values from 0 to 1 with positive and negative values here is the code [CODE]#include <stdio.h> #include <stdlib.h> void populate(int generations) { int seed, ttt; seed = 456739853; … | |
hi, i want to know how to get a text file situated anywhere in my drive and to read it. | |
Q. Write a function Stars() whose input are an array of characters(a), the size of the array(n), and a character(ch). This function should replace all occurrences of ch in the array, a, with a star(*), and return the number of times the replacement was made. So far I have the … | |
I'm working on a simple library to load data from .3ds files. I was working on it, and everything was working almost perfectly, when I realized that I should have been reading four bytes for each item in facelist[] and I was only reading two (code attached). I simply modified … | |
[code=c] #include <stdio.h> #include <stdlib.h> #include <math.h> void estimate(float data[], int n, int m, float *xms, float d[]) int main(void) { double data[] = { //Loads(~1000) of data vavues between +1 and -1. Ex: -0.15709, -0.25413,... }; float xms[m]; float float d[m]; for (i=0;i<m;i++) { //Function call here to fill … | |
hello I have the following [code=c] while(fgets(b2b_rates_address,1000,in_fp) != NULL ) { strcpy(rates_details[j].ig1, strtok(b2b_rates_address,",")); printf("rates_details[j].ig7 = %s\n",rates_details[j].ig1 ); strcpy(rates_details[j].ig2,strtok(NULL,",")); printf("rates_details[j].ig7 = %s\n",rates_details[j].ig2 ); strcpy(rates_details[j].ig3,strtok(NULL,",")); printf("rates_details[j].ig7 = %s\n",rates_details[j].ig3 ); j++; } [/code] The issue i have is this:- It works fine up to field ig3, this is due to the fact that … | |
im just trying to use the inputted terms in the main function. the error is: [B]hwk6.c:10: error: expected ';', ',' or ')' before '*' token[/B] [code] #include <stdio.h> #include <math.h> int getTerms(void); int term1; int term2; int term3; int term4; int term5; int main(int term1*, int term2*, int term3*, int … | |
I have a string , i want to give it a blink effect ... is there any specific function for it . | |
Hey, I've been stuck on something all day, when I first looked at it I thought it was going to be relatively easy. I want to be able to let the user return to a menu whenever they press enter without typing anything else. I've looked on google, but I … | |
Hi, I have somewhat of a mysterious crash on my program. As far as myself and my primitive knowledge are concerned, this litterally does not make any sense at all, but maybe you guys can make some sense out of it. Basically, inside a loop, I modify a float variable … | |
I'm trying to figure out how to parse options such as -h out of the arguments passed on the command line when the program is called. Here is my code so far. I compiled it with gcc -Wall -o options options.c and got no warnings or errors. Although, when I … | |
Why doesn't it work when I enter "NO"? [CODE=c] do{ printf("\n\nDo you wish to continue (yes or no): "); uppercase(fgets(progress, sizeof progress, stdin)); fflush(stdin); ((strcmp(progress,"YES")!= 0 && strcmp(progress,"NO")!= 0)?printf("\nOnly 'yes' or 'no' will be accepted!\n"):printf("\n")); }while(strcmp(progress,"YES")!= 0 && strcmp(progress,"NO")!= 0);[/CODE] | |
hi, can u tell me y linker gives error when we try to define a variable in a header file and include this in more than one source file? [code] /*test.h*/ int i =0; /*1.c*/ #include "test.h" i++; /*2.c*/ #include "test.h" i++; [/code] whereas the same works fine if i … | |
Hello Geeks, I am working on a program for date,month calculation. I found this code used to convert to Gregorian format for calculation. It would be great full for me if anybody can explain this ... like 0.75 yy/4 .4*mm what are these constants why m-1, yy-1 etc.. [CODE] long … | |
I don't know about C, but I read that C++ doesn't have any "standard" library for networking stuff. I was wondering which libraries for C were more popular or higher acclaimed. And who better to ask than the experts themselves? Many thanks in advance diode | |
I have write a code to read data from a file and i try to put it in a queue but i don not know who to put in th queuue.IS anybody who can give an example??? my code is bellow: [code=c] if((fp=fopen("read.txt","r"))==NULL){ printf("\nERROR OPENNING THE FILE"); exit(1); } while(fgets(line,100,fp)) … | |
Hello, Before I switched to Ubuntu, I used to have some cool boot screens for windows and now I want to create some for Ubuntu, but I have no clue where to begin. What I do know: - text input and output in C - animation in Java - using … | |
I have some question on structure padding Can any one help me! Structure padding is done for alignment(is it right) 1. Why is it to be aligned? [CODE] 2. struct sfoo { int a; char i; } sizeof(struct sfoo) = 8 // 4+1+3(padding) struct sfoo { //int a; char i; … | |
[code=c] #include <stdio.h> #include <math.h> void getTerms(void); int getPattern(int* term1, int* term2, int* term4, int* term5); void patternAdd(int* term1, int* term2, int* term5); void patternMultiply(int* term1, int* term2, int* term5); int term1; int term2; int term3; int term4; int term5; int test1; int test2; int addval; int multval; int main(void) … | |
Basicaly I want to see if a a number (in my example: 12345678910 ) contains another, smaller number (1234). For this I decided to turn a into a string. For some reason my "in" function never worked. But now for some reason if I ever decide to invoke, there's a … | |
i have two questions right now in my mind : [B]question - 1 :[/B] please have a look at this code : [CODE]void function (int recd) { printf ("%d", recd); } void main() { int p=10; function(p); }[/CODE] here...when p is passed to function, the thing that actually takes place … | |
Ok... I did 3-4 project with your help. I have got now three 100 grades and I am so happy thank you all :) But now I have a huge problem... My new project is mess....... [COLOR=#000000][/COLOR] [COLOR=#000000]"""You are been asked to prepare the creation of a pseudo-random number generator. … | |
Hello!! I am using Keil Compiler C166. I want to know how much ROM, RAM has been utilized by the code. Can someone help me for this? | |
Hi there, I'm becoming increasingly confused trying to implement an array of pointers, that themselves point to nodes in a linked list. Basically my problem is that I need to sort through an existing linked list per element, over all other elements (which works fine) based on a particular criterion, … | |
Please forgive me, I know *VERY* little about C... I can hack out enough to do what I need to do for the most part but I'm absolutely lost on a project I need to finish. I am writing a wrapper for common RHEL commands so that our helpdesk technicians … |
The End.