15,540 Topics
| |
Just a Question on C programming basic some instructors have different ways of using either getche() or return 0; as bottom code on main function. Which is more better to use getche() or return 0;?[code]Getche() vs return 0;[/code] | |
Hi, I have linkend list in my program and I need to swap two elements. [CODE]typedef struct { int day; char month[10]; } LData; typedef struct element LElement; struct element { LData data; LElement *next; } typedef struct { TLement *head; } TLinked; [/CODE] Then some basic functions - initialization, … | |
hi all Can we (compile and execute) or just execute a c file from another c file? am asked this question and i am unable to find any solution to this problem. A 'c' file is executed and it must contain code that will execute another 'c' program olease help … | |
hi all, i got stuck up in running a C program(project).it says 'binary not found error'. i am able to debug it,under ARM cortexa8 configuration. here what does refer to.....is it .exe file or .axf file. how can we generate those .exe and .axf files. anyone please clearly explain running … | |
I wrote this program and am trying to simplifying by creating a character array. How can this be done please? I found some help here [URL="http://www.java2s.com/Code/C/Data-Type/Forloopachararrayusingpointer.htm"]http://www.java2s.com/Code/C/Data-Type/Forloopachararrayusingpointer.htm[/URL] but couldn't really implement that in my program. [CODE] //inputs five strings representing integers, converts the strings to //integers, sums the values and prints … | |
Hi there i am trying to make a program that takes multiple files from the command line. I think i have got my my word count working right, but my question is how do i get it to read multiple files on the command line. Like when i do ./a.out … | |
Im writing a code that ask for two positive integers entered from the keyboard. The first integer N is odd in range of 3-15 and the second with be an initial value I. N will be the size of the array. Beginning the center of the NxN array with the … | |
[CODE] #include<stdio.h> #include<math.h> #include<string.h> // function prototype int rv (int, int [], double []); //main function int main() { int n; int res[10]; double vol[10]; double I[10]; double C; int i; for (i = 0; i < 10; i++) { printf("Enter R and V for resistor %d: ", i+1); ReadRes(i,res,vol); … | |
I am making a staid lib that does some simple math but whenever I go to do something in time_t, time64_t, or bool it gets a "expected ; before FUNCTIONNAME." how would I use time_t, time64_t, and bool in a static lib? | |
so i have to make a function that displays the binary representation of a 32 bit integer this is what i have [CODE]#include<stdio.h> #include<stdlib.h> #include <string.h> #include<stdio.h> void inttobin(int c) { char * s ; char * p ; size_t n = 8*sizeof(unsigned int); p = malloc(n*sizeof(char)); while (n-- > … | |
Hi, I have recently gone through some C internal stuff, addressing schemes(logical,relocatable and physical). what i dint get here is how are these inter-related.I do understand that these three are genearated by different tools. I want to know how exactly one is useful for other in executing the program in … | |
Hi all, Can anyone please enhance the following code to print a string reverely ina consecutive manner using two dimensional array. The program which i tried in codepad.org is follows: [CODE]#include<stdio.h> #include<string.h> int main() { char a[4][4]={'j','u','s','t'}; int i,l,j,k,b=4,n; printf("Enter the string"); printf("\n"); for(i=0;i<1;i++) { for(j=0;j<b;j++) { printf("%c",a[i][j]); } } … | |
i used turb0 c++ in windows 7 but i does not display a full screen mode.are there any tools that run c and c++ in windows 7??? | |
Hi, I'm looking at shared memory in C and I seem to have encountered a bit of a problem. I'm fairly sure that I may be misunderstanding something here. I'm trying to send an array of structs to another process via shared memory. When the other process goes to read … | |
| |
I am new in c and dont know how to make a database in it i know that there is no database connection with c but i want to make project on employee data using file processing like this 1. add (employee name, age, contact number) 2. edit (employee name, … | |
Hello, is good idea to mess data using array? is this good way to encrypt an message? [CODE] char x[50]; gets(x); for(int i=0; x[i]; i++) { printf("%c", x[i] + An mathematic function here); // Example printf("%c", x[i] + (1800 /2) ^3 * pi); } [/CODE] Here is something i create, … | |
Hey guys, I wrote a program and this 2 lines came up with the same error declaration: [ICODE]Scanf("((%d/%d)*%d)", &Mark1, 40, 100; Printf("Average of marks is: %.3f", Avg);[/ICODE] Both these lines came up with these error comments below: Line 1: Function "Scanf" should have a prototype. Line 2: Function "Printf" should … | |
Hi, Can anyone tell me the c code for taking snap and saving it to directory. Thanks | |
hello every body, My name is roxy and i am from brazil.I want to expand IPv6 address using inet_pton().After that increment the address by 1 using C code.If my address is - 1234:12::ffff then after expand it will be 1234:0012:0000:0000:0000:0000:0000:ffff When I increment the address it will display - 1234:0012:0000:0000:0000:0000:0001:0000 … | |
Hi, I am trying to figure out allegro, and so far, so good. But I ran into this one snag in this code [CODE]const float FPS = 60;[/CODE] Does this set FPS? Someone on another forum said no, but it seems like that it is a predefined function that changes … | |
Hi, hello everyone. I am having troubles modulating these dtmf codes in visual studio 2008 in C. After going to Properties and selecting compile as C code, i complied it( F7) and then debuged it(F5) and then i was stopeed by this error window saying: Unable to start program 'C:\Users\Trinetra\Documents\nltvc\dtmf\Debug\dtmf.exe.' … | |
Hey , I urgently need a program to calculate a Bodmas Expression In C | |
I have a problem with this code too. right now I have a segmentation fault but before I couldn't get the correct maxValue. [code] int maxValue(node* head, int max) { node* p; if (head == NULL) { return(1); } else { p = head; max = p-> item; while(p != … | |
[code=c] #include <stdio.h> int main (void) { float a; a = 7/3; printf ("%f\n", a); } [/code] Result : 2.000000 Why is gcc compiler printing 0 after decimal? | |
This is what the question is stating: Write a program that inputs a line of text using function fgets() into a char array s[90], then it outputs the line converted to uppercase. For function [ICODE]fgets[/ICODE] to be used, am i correct if I understand that the user doesn't have to … | |
[CODE]#include <stdio.h> int fill_array(void); int display_array(int count); typedef struct { char worker_name[20]; float hourly_pay; int hours; }WorkerRecord; int main() { WorkerRecord info[50]; int count, k; float average_wage; count = fill_array(); display_array(count); for(k = 0, average_wage = 0; k < count; k++) { average_wage += info[k].hourly_pay; } average_wage /= count; printf("\nAverage … | |
Consider there is a string [COLOR="Red"]"hai welcome..."[/COLOR] I need to [COLOR="red"]print the string [/COLOR]as such [COLOR="red"]leaving the first three characters..[/COLOR] I should not use in-built functions or others... It should b [COLOR="red"]done in a single printf statement [/COLOR]by [COLOR="red"]changing the control string pattern..[/COLOR] | |
[CODE]#include<stdio.h> int fun(); /* function prototype */ int main() { int (*p)() = fun; (*p)(); return 0; } int fun() { printf("WEB\n"); return 0; } [/CODE] this program is working fine and printing WEB as well int (*p)() = fun; how these two consecutive lines of codes are working please … | |
Hi! I want to read integers from a string of integers and store the individual integers in an array. The problem is that I don't know how many integers in the string would be otherwise I would have used sscanf with a format specifier. For example: Input: 10 20 12 … |
The End.