15,551 Topics
| |
HI All How can we generate a sine wave without using the sin() function. Thanks pretu | |
hi all, I am trying to pass an array to a function. an array is like char game[4] = {'S', 'R', 'D'}; i wanna pass the entire array to a function which accept. like this void name(char *game) How to do this..? | |
I have two different ways to traverse a tree adt that essentially do the same thing except one is a recursive function and the other is iterative. How could I compare the efficiency between them? RECURSIVE [CODE]inorder(node) if node.left ≠ null then inorder(node.left) print node.value if node.right ≠ null then … | |
Aside from using switch statements, do-while loops, and if-else trees, is there a good way to complete error checking after a user input from the keyboard? | |
hi all, i am trying to make a prog. which will read the first line of a text file and put the first line into an array and pass the entire array to a function. Here is my code: [CODE]#include <stdio.h> #include <conio.h> #include <string.h> #include <string.h> void exe(char cmd) … | |
I need to know a bit about this "default int" thing in C. What I mean is, is this actually ok and with what version of C is it ok? [code] main() { return 0; } [/code] As far as I knew this was standard modern C (i.e., no retarded … | |
[CODE]#include <stdio.h> #include <conio.h> main() { int i; char full; char array[10]="ABCD"; for (i=0;i<=6;i++) full = array[i]; printf("%c",full); } [/CODE] I wanna convert an array to a full character .So that i can print the character like this line printf("%c",full); This program unable to print the character?? Whats wrong in … | |
Hi there Everbody, I am using Borland c++ 5.02 for my C projects but a funny thing happens at run time.Though the source code compiles minus errors, I can't get to see my output because the command prompt just appears and disappears straight away.What could be causing this? | |
Hi guys here is my problem.I am trying to send ICMP packets to a HOST using WINSOK.So here is my code: [CODE]#define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <ws2tcpip.h> #include <stdio.h> #include <stdlib.h> #define IP_RECORD_ROUTE 0x7 // // IP header structure // typedef struct _iphdr { unsigned int h_len:4; // Length of … | |
Hello! I am making a program which does many computations for a Photovoltaic system. The problem is that i get a strange segmentation fault error when I run the program. Here is where it crushes (at for-loop of calculation S5) : [CODE] commands..... ... ... /******************** WIRING *******************************/ Ni = … | |
Im still noob on C Programming. And I just want to ask can you help me understand this codes. Like share some link about this topic and is there other way on doing it? The output of this is like: When I type HELLO the output will be URYYB (Rot13 … | |
Hi all, I have a simple code below [CODE]#include <stdio.h> #include <string.h> typedef struct { int apn_in_use; } bts_pdn_con_t; typedef struct _bts_pdn_con_list_t_slot { bts_pdn_con_t conn; struct _bts_pdn_con_list_t_slot *next, *prev; } bts_pdn_con_list_t_slot; typedef struct { bts_pdn_con_list_t_slot *head, *tail; } bts_pdn_con_list_t; typedef struct { int umsi; bts_pdn_con_list_t connections; } bts_ue_t; int funct(bts_ue_t … | |
Ok, first of all, I'm not sure if this belongs to C section. Since WinAPI is written in C, I'll post here. I'm using OpenGL with Win32 windows (not sure how to call that). I can't switch to fullscreen mode after creating the window. I'm using Windows 7 (64-bits) and … | |
char=l; string='hello'; This is my input,The particular character present in the string to change lower letter to upper letter. Output: heLLo Please anybody help me; | |
Whenever I try to compile my code for this function my compiler keeps throwing projectB.c:31:15: error: conflicting types for ‘returnDegree’ projectB.c:19:17: note: previous implicit declaration of ‘returnDegree’ was here [CODE] #include <stdio.h> #include<math.h> int main(){ double sanantonioLat; sanantonioLat = returnDegree(29.0,25.0,51.0); printf("blah %f\n" , sanantonioLat); return 0; } static double returnDegree(double … | |
hi, i want to compile a file through the makefile command.Once i type make example it says that it is up to date but when i try to run it (correct me if I'm wrong ./example) it says that permission was denied..does anybody have any clue about that? | |
If I have the following code [CODE]#include <stdio.h> #include <ctype.h> #include <string.h> int main(void) { char prose[] = "to be or not to be that is the question"; int i, len; len = strlen(prose); puts (prose); return 0; }[/CODE] where would I insert the function Cap to capitalize the first … | |
[CODE]void printer(char x) { int d, b, z; for(z=x; z>=1; z--) { for(b=z; b<=x-1; b++) printf(" "); for(d=z; d>=1; d--) printf("%d ", d); printf("\n"); } }[/CODE] that's my code which is supposed to print 4 3 2 1 4 3 2 4 3 4 when input is 4. however, it … | |
hii to all my frnd;;;; i want to know about function ; how it calls by value and address? so plz help me;;;[U[/U] | |
Can someone please explain to me the difference between ++i and i++ when written as part of an expression (i.e. within loops and if statements) ? Thanks :) | |
Wondering if someone could guide me in the right direction. I think this code is right but can't figure out why my switch loop won't access my char array of grades and add it to an int array. [code] #include <stdio.h> int main (void) { char grade[32] = { 'A', … | |
Hi. Can someone help me with how to transfer/print your last output in a word file? I'm researching and can't find a way on C. My code in C so don't suggest solutions for C++ thank you :). | |
My problem is that i want to get the 1st part only of the string ive done based on my code i can get the audio/x-aiff by finding the space but want i want to do is i want to is get or print the .aif is there any way … | |
{-='Smallest, Largest & Sum of 5 numbers using Dev-C LaNGuaGe'=-} | |
[B]Can anyone know what program what's the best for this problem?[/B] -->Create a program that will compute for the sum of all even numbers among the ten integers inputted and print them out. Thanks in advance!:) | |
int a[3]={1,2,3}; printf("%d",a[3]); While I'm executing this snippet, I'm getting the output as 2. Is 2 a garbage value here? I don't think so... Can anyone explain how 2 comes instead of a garbage value? Any answer could be appreaciated. | |
So I got curious with OpenGL and I ended up having a copy of the "redbook", as people call it. Initially when I tried relying only on online sources like tutorials and whatnot they were all written using WinMain which was a drag so that sort of put me away … | |
Hello, I am creating a card game and need some advice/pointers or code snipets if possible on sprite movement in the sence I need to create an action of a card been drawn from the deck. Basicly I need to make the sprite(card) move from the deck posion(x,y) to the … | |
I'm trying to convert hexadecimal values to Binary. I've done Decimal values to Binary up to 32 bits in this way: [CODE] #include <stdio.h> int showbits(int);/**************function*prototype******************************/ int main() { unsigned int num; printf("enter the number."); scanf("%d",&num); printf("%d in binary is ",num); printf("\n"); showbits(num);/*********************function*call********************************/ return 0; } showbits (int n)/******************function*definition****************************/ //* … | |
[CODE]char main()/*Start of the function main???*/ { char choice1; char choices = 'y'; while(choices == 'y' && choices != 'n'){/*while loop initialization*/ print(); getchar(); scanf("%c",&choice1); printf("%c",choice1); switch(choice1){/*Switch case statement,,,*/ case 'a': case 'A': addContact(); break; case 'f': case 'F': search(contacts); break; case 'v': case 'V': list(); break; case 'e': case … |
The End.