15,548 Topics

Member Avatar for
Member Avatar for kandarpa

Hi all I have a function and it is being called by many other functions. Is there any method or macro which can return the function name which calls the current function. EX: [code] int a() { pintf (<required a macro for printing the caller function name>); /* do operation …

Member Avatar for बालाजी
0
7K
Member Avatar for J_SON

Hi , I am trying to do a couple of bitwise operations on some hex numbers but for some reason i cant compile. Apparently, it wont be possible with my method: #include <stdio.h> float tv,lv; float nv = 0x01FE; int main() { tv = 0x7FFC; lv = 0x8000 & tv; …

Member Avatar for J_SON
0
265
Member Avatar for Prithwish

Hi, Thanks to everyone who would be reading this post. I would like to know how to write programs in C to control Hardware for modems, printers and how to get the basic concepts for writing device drivers. thanks once again !! Prithwish

Member Avatar for rubberman
0
313
Member Avatar for Vish0203

I was trying to solve the Euler problem number 50, and wrote the following code and got the answer as, no. of primes = 536 and prime value is 958577 But, when i search the answer for this on internet, it says 543 primes and prime is 997651 why does …

Member Avatar for Adak
0
526
Member Avatar for Qwert_1

I have been trying to print all the combination of a string using recursive call. I have studied a code given below . It prints the combination but now i have to store the strings in an array . And i don't get it how do i do that ? …

Member Avatar for Adak
0
228
Member Avatar for dendenny01

Whenever I try to run this code in turbo c++ 4.5 I recieve an error "General Protection Exception List.c 60 List(2) 0x24DF:0x0157 processor Fault" whereas when the same Program is run in Turbo c++ 3 Dos version It Compiles and Runs Propely without any error. Please Help. #include <stdio.h> #include …

Member Avatar for Ancient Dragon
0
911
Member Avatar for MadnessCow

Hi guys. I'm pretty new to C program. I've been given this assignment to write a program that asks the user thow many terms of the serires equation to use in approximating PI. The formula given is pi=4X(1- 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - …

Member Avatar for Adak
0
6K
Member Avatar for killer88
Member Avatar for killer88
0
207
Member Avatar for srivardhanms

Hi, Can anyone give me an efficient algorithm for adding an element into a sorted matrix of linked list such that the size of the columns remains constant. Thank-you, Sri

Member Avatar for srivardhanms
0
475
Member Avatar for Adak

Demonstrates the Right Hand Rule maze solving algorithm, with some sweet console colors and text display and erasing, in Windows. Note that if the Start is moved away from all the walls in the maze, the right hand rule fails, circling endlessly. Also, a similar failure happens if the Start …

0
3K
Member Avatar for SoreComet

Hey Guys, I need your expertise. Please help me. In the following program, 2 matrices and given values and then displayed. The program works fine but I really can't understand how it works. #include <stdio.h> #include <stdlib.h> void getmat(int a[50][50],int n) { int i,j; for(i=0;i<n;i++) for(j=0;j<n;j++) scanf("%d",&a[i][j]); } void printmat(int …

Member Avatar for deceptikon
0
165
Member Avatar for roeljaime

Write a program that will asks the user for a positive integer input. Print the even numbers between 1 and the inputted number on the screen. 2.2. Write a program that will compute the sum of the first N odd numbers. Example: If the value of N is 5, then …

Member Avatar for rishif2
0
96
Member Avatar for Muhammad Waqar_1

hi every one! i have a question, how to pass arguments from other functions to main. i want to write a program like nano well not exactly like nano editor. I have a function f_read(char* filename[]), and fopen() get filename[1] as file name and *filename[2] as "r" read mode and …

Member Avatar for Ancient Dragon
0
280
Member Avatar for pedrololarol

Hey everyone. I'm trying to use the g2 library in CodeBlocks but I can't seem to get it properly installed. Can somebody please explain me what to do, step by step? Best regards

Member Avatar for gusano79
0
563
Member Avatar for infatuate

So I just found out what Rot13 is and what its suppose to do but I now I have to implement a code that will allow me to execute Rot13. Does anyone have any tips on where I should start? (besides the beginning -__-). Any help is appreciated! thank you!

Member Avatar for L7Sqr
0
142
Member Avatar for altic

Hey there, please help me how to solve this problem. I need to find my CPU temperature in C code on Linux for my new program. Can anyone tell me???

Member Avatar for nash_1
0
11K
Member Avatar for poloblue

For the MIPS assembly instructions below, what are the corresponding C statements. a) addi f, f, 4 b) add f, g, h sub f, i, f So far, I have this but I don't if it is correct. a) f = (f + 4); b) f = g + h …

Member Avatar for DeanMSands3
0
50
Member Avatar for blob84

Hello i implemented this FIFO queue: #include <stdio.h> void enqueue(int *, int); int dequeue(int *); int qempty(void); int head = 0; int tail = 0; int qerror(void); #define N 4 int main(void) { int i = 0; int v[N]; while (i < 10) { enqueue(v, i); i++; } while (!qempty()) …

Member Avatar for Nutster
0
11K
Member Avatar for totalwar235

I am attempting to recompile a C program i programmed on linux. These are the errors i recieve: c:\users\dsu\dropbox\codes\c\gamereedtucker\main.c(28): error C2275: 'FILE' : illegal use of this type as an expression c:\program files\microsoft visual studio 10.0\vc\include\stdio.h(66) : see declaration of 'FILE' c:\users\dsu\dropbox\codes\c\gamereedtucker\main.c(28): error C2065: 'sy' : undeclared identifier c:\users\dsu\dropbox\codes\c\gamereedtucker\main.c(29): error …

Member Avatar for totalwar235
0
471
Member Avatar for rabbit337

My task is to create a complete binary tree. The only requirements are that it be a dynamic tree with nodes and pointers - I may use temporary arrays to help with the intial tree construction. Where I need help is with the insert(Node) method. Here's what I have so …

Member Avatar for sonu_1
0
1K
Member Avatar for Thundermax

Hello guys, I need to make a program that counts the number of times a particular word appears in a text file on a line. For example, the User chooses the word "test" to be told at the end of each line of txt should show how many times that …

Member Avatar for Adak
0
150
Member Avatar for friendly1

http://www.getfriendlynotes.com/index.php?q=topic_disp&subsno=3&prog=431251#tpc1

Member Avatar for best4earn
0
90
Member Avatar for Rachana_1
Member Avatar for lohith44
-2
584
Member Avatar for parth2911

optput its not proper i am tring to print 1 to n given number prime number plese solved error.....

Member Avatar for nitin1
0
302
Member Avatar for Zsmash

#include <windows.h> #include <stdio.h> #include <conio.h> void gotoxy(int x,int y); int main(int argc, char *argv[]) { char urname[1],surname[1],fullname[1]; start: system("COLOR 1c"); gotoxy(11,9); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,10); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,11); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,12); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,13); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,14); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(11,15); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),291); printf(" "); gotoxy(14,10); …

Member Avatar for Ancient Dragon
0
277
Member Avatar for Falcon143

/* Hi, In my process of C code optimization*/ Clip(int Val) { return (curr < 0 ? : ((curr > 255) ? 255 : curr)); } /* I want the int value to be clipped between 0 to 255. Is there any other way to optimize above code snippet? */

Member Avatar for Banfa
0
2K
Member Avatar for Falcon143

/*Hi, I was trying to optimize my application in C. In that process to reduce the complexity at condition checks which of the below is efficient,*/ if(bFlag1 && !(Var == 1) && bFlag2) //or if(bFlag1 & !(Var == 1) & bFlag2)

Member Avatar for Falcon143
0
175
Member Avatar for np complete

So I was writing a program that would take a string from clipboard, do some stuff and put the new string back to clipboard. My code so far is posted below. The problem is I want my program to wait for me until I 'ctrl+C' something. I know that `GetClipboardData()` …

Member Avatar for BobS0327
0
248
Member Avatar for general2012

#include<conio.h> #include<stdio.h> #include<stdlib.h> #include<math.h> int k,i=0,m=0,flag=0; int coef[10]={0}; float x1=0,x2=0,t=0; float fx1=0,fdx1=0; what is the benefits if the variables are defined outside of the function ,just after #include thanks!!

Member Avatar for general2012
0
129
Member Avatar for general2012

for the codes under for loop this error massage is showing 19:37 C:\Users\azr\Desktop\Untitled1.c invalid suffix "xy" on integer constant #include<stdio.h> #include<conio.h> #define func(x,y) 3xy int main() { int x0,y0,n,y1,k1,k2,k3,k4,h; printf("enter the values"); printf("enter x0:"); scanf("enter x0:%d",&x0); printf("enter number of x values:"); scanf("no. of x values:%d",&n); printf("value of hight h"); scanf("value …

Member Avatar for general2012
0
224

The End.