15,552 Topics

Member Avatar for
Member Avatar for dotancohen

When printing an int to stdout, the %d type is used. Why "d"? The other types (s for string, c for char, f for float) all make mnemonic sense, but I cannot figure out why "d" for int. It's not short for "double" or "decimal" I think.

Member Avatar for Ancient Dragon
0
128
Member Avatar for pretu

HI All How can we generate a sine wave without using the sin() function. Thanks pretu

Member Avatar for jayeshkamble143
0
590
Member Avatar for debasishgang7

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

Member Avatar for abhimanipal
0
179
Member Avatar for logicmonster

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 …

Member Avatar for abhimanipal
0
131
Member Avatar for logicmonster

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?

Member Avatar for abhimanipal
0
184
Member Avatar for debasishgang7

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

Member Avatar for abhimanipal
0
188
Member Avatar for pseudorandom21

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 …

Member Avatar for Narue
0
145
Member Avatar for debasishgang7

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

Member Avatar for abhimanipal
0
163
Member Avatar for arlir

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?

Member Avatar for arlir
0
111
Member Avatar for debasishgang7

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 …

0
162
Member Avatar for babis87

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

Member Avatar for Salem
0
2K
Member Avatar for ticktoc09

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 …

Member Avatar for syria718
0
116
Member Avatar for reza.adinata

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 …

Member Avatar for Narue
0
225
Member Avatar for venomxxl

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 …

Member Avatar for venomxxl
0
534
Member Avatar for mohanraj.m

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;

Member Avatar for WaltP
0
153
Member Avatar for Barnifericus

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 …

Member Avatar for Barnifericus
0
137
Member Avatar for libathos

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?

Member Avatar for libathos
0
123
Member Avatar for ari$av3s

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 …

Member Avatar for arindam31
0
166
Member Avatar for ineedsomehelp:3

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

Member Avatar for Arbus
0
212
Member Avatar for skmajharuddin

hii to all my frnd;;;; i want to know about function ; how it calls by value and address? so plz help me;;;[U[/U]

Member Avatar for Adak
-2
77
Member Avatar for Dani

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

Member Avatar for WaltP
0
652
Member Avatar for Teelnaw

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

Member Avatar for ari$av3s
0
278
Member Avatar for Trypanosoma

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 :).

Member Avatar for Ancient Dragon
0
674
Member Avatar for anjoz

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 …

Member Avatar for arindam31
0
111
Member Avatar for clarence_cool03
Member Avatar for kagotsky

[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!:)

Member Avatar for arindam31
0
104
Member Avatar for harikrishna439

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.

Member Avatar for arindam31
0
162
Member Avatar for asrockw7

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 …

Member Avatar for Sodabread
0
579
Member Avatar for DOT6

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 …

Member Avatar for DOT6
0
271
Member Avatar for D33wakar

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

Member Avatar for D33wakar
0
404

The End.