15,551 Topics

Member Avatar for
Member Avatar for Justmehere

Can anyone tell me what the purpose of C functions which start with "__" ? Also another question is the same use of the "__" in defines like #define __HTTP_VERB_GET "GET"

Member Avatar for dwks
0
120
Member Avatar for Paulville

Hi People I'm a newbie in c, I learn in c++, but I don`t really know to much. A friend make a code in c, working in a linux pc. And works perfect. I normally work in Micorsoft Visual Studio, but this c code, seems not to work well (88 …

Member Avatar for Salem
0
160
Member Avatar for rohit83.ken

this code removes comments please help in correcting the code //Program to print a file by removing Comments #include<stdio.h> void main() { FILE *fp; char ch; //clrscr(); fp=fopen("temp.txt","r"); while(1) { ch=fgetc(fp); if(ch==EOF) break; else { if(ch=='/'){ ch=fgetc(fp); if(ch=='/') { while(1) { ch=fgetc(fp); if(ch=='\n') goto label; } } if(ch=='*') { while(1) …

Member Avatar for Salem
0
205
Member Avatar for phylon

Does knows any library that produces the inverse of a given matrix ? Or is there any C example available ?

Member Avatar for Duoas
0
68
Member Avatar for Narue

I've been writing my own implementation of stdio.h whenever I get a few spare minutes recently. Nothing fancy or thorough, and without wide character support, it's hardly conforming. But I was looking at one of my intermediate versions of printf and could only marvel at how ugly it was. So …

Member Avatar for Duoas
2
178
Member Avatar for Sh13

I'm having problem with storing values in multi dimensional arrays. I need to have 10 * 10 array with rows and columns. I have intitialized the array with blank spaces " ". But after this I need to store letters like 'A' 'C' 'S' on specific locations in that array. …

Member Avatar for Aia
0
305
Member Avatar for #include_rose

I'm having some trouble understanding the advantages and disadvantages of using scanf over fgets. When we have allocated memory using an array for eg, it is not wise to use scanf since buffer overflow can occur. But in what way does fgets prevent that from happening? Also, if you are …

Member Avatar for #include_rose
1
753
Member Avatar for Fredszky

Hello Im new to C programming, im trying to learn how to create a textfile with whatever name the user of the program wants. something like this, please ignore that this code wont work, its just so you might understand how i am thinking: [code] FILE *file; printf("name of the …

Member Avatar for Fredszky
0
103
Member Avatar for restrooms

pls help me on solving my project. this program isrunning but when i press enter it will be sent back to the compiler. pls help me thanks in advance [code=c] #include<stdio.h> #include<conio.h> #include<string.h> string(); int x,i,a,b,y; int stocks[5]={4,5,3,6,2}; int code[5]={100,101,102,103,104}; float cost[5]={5000.00,4000.00600.00,3500.00,7000.00}; char des[5]={'t',d',v',v',c'}; float PA ,dis,net_pay,downpayment,monthly; int main() { …

Member Avatar for WaltP
0
137
Member Avatar for locy

i try to compile this programm useing pluto,it shows me error .where schould the fehler be? [code=c] #include <"stdio.h"> int main() { int counter; int even=0; int b= 7,int h= 10; if h+ = b % 10; b /= 10; for( counter = 1; counter <= 10; counter++); { if …

Member Avatar for Aia
0
98
Member Avatar for redaqen

Hey guys, I'm a long time lurker, and first time poster. Please be kind. Anyways, for one of my classes, Principles of Algorithm Design 1, we had an assignment where we had to create a program that would encrypt and then de-encrypt a message by offsetting the characters by a …

Member Avatar for Narue
0
196
Member Avatar for csteverun

I can't find the answer to this in any C reference. The question is, is there any way to do this: [code=c] #define MAX 10; struct aStruct { int a; int b; }; typedef struct aStruct aType; aType array_of_atype[] = { {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, …

Member Avatar for csteverun
0
97
Member Avatar for Exsiss

I need to make the program: [QUOTE]Write a program to ask for a string and a single character. Read in the string using getchar(). Read in the character using scanf(). Count and report the number of occurrences of the character in the string. Add a brief comment at the beginning …

Member Avatar for Narue
0
316
Member Avatar for skyah

Hi. I was wondering if any one could help me with this program. I didn't get any error messages. It was excecuted but the output was incorrect. I got Unordered data: 7 3 66 3 -5 22 -77 2 After pass 1: 7 3 66 3 -5 22 -77 2 …

Member Avatar for ithelp
0
92
Member Avatar for Aia

You have a problem with your code. You need help. You are in a hurry. What can you do? Post for help at Daniweb as fast as you write, correct?. Wrong. The first thing you should do is to read the rules on posting and specially how to properly make …

4
2K
Member Avatar for beatlea

Hello, Is there any way of reading words from a string containg a few words separated by white spaces using a loop? I don't know how many argumets the user will input. I wanted to do it like this: [code] for(i=0;i<wordCounter;i++) { sscanf(input,"%s",argument[i]); } [/code] But this keeps reading in …

Member Avatar for Salem
0
3K
Member Avatar for skyah

I have to write an interactive program using scanf() to read in seven strings input by the user. The program should print the seven strings as a list, then sort them alphabetically and print a new list. I have to use the function strcmp() to assist in the sorting of …

Member Avatar for Narue
0
214
Member Avatar for locy

how do i write a C programm to add two figures together e.g b and h if b = 0125 and h =2354 b = 0+1+2+5 = 8 h = 2+3+5+4 = 14 and the output to be ++++++++ * * * * * * * * ++++++++ * * …

Member Avatar for locy
0
243
Member Avatar for csteverun

I could really use some help here. I can't figure out what's the problem is, so I've assumed it's all C's fault. I have a function: [code]pf_plot32(Uint32 data[], Uint32 dl, pfplot pattern[], Uint8 pl, Uint32 pr, struct pf_path32 *path)[/code] ..Which takes a pointer to a structure: [code] struct pf_point32 { …

Member Avatar for csteverun
0
208
Member Avatar for near

Hello everyone,i need help here(urgent!!): here is what my program for: 1.user will enter a string not more than 300 words. 2.change string to lowercase 3.count each word occurrence example: This is a test. This program will count number of each word occurrence. this = 2 is = 1 a …

Member Avatar for near
0
226
Member Avatar for kemboy

this is suppose to be a binary search to return the number of times a number is found in the array.............but for some reason it isnt calculating the correct number of times the number is found....already had my paper and pen out trying to find the error but it aint …

Member Avatar for ithelp
0
87
Member Avatar for bobei89

This program is wrotten by me college's teacher, and i so confuse and do not understand why is like this coding. [code=c]#include<stdio.h> void main() { int i,j,class_size,mark; int freq[11]={0}; //why make freq[11] for 11 variables?// printf("This program produces a bar chart\n"); printf("showing marks distribution...\n"); printf("\nHow many students?"); scanf("%d", &class_size); //make …

Member Avatar for bobei89
1
153
Member Avatar for beatlea

Hello, I have to write a program using exec() where user can specify the pathname and arguments. I am trying to read in the arguments in the following way: [code] #include <stdio.h> #include <unistd.h> #include <sys/wait.h> int main() { ... int i; char *cmd[100]; char argument[100]; i = 0; for(i=0;i<3;i++) …

Member Avatar for Aia
0
116
Member Avatar for restrooms

can someone tell me if the code is right. cuz my T.C doesnt work. [code=c] #include<stdio.h> #include<conio.h> int num1,num2,num3; int num4,num5; int main() { clrscr(); printf("ENTER NUMBER"); scanf("%d",&num2); num1=1;num2=1;num3=1; printf("%i",num1); printf("\t%i",num2); for(num1=1;num1<=num2;num1++) { num3=num1+num2; printf(\t%i",num3); num1=num2; num2=num3; } getch(); return (0); } [/code]

Member Avatar for hopalongcassidy
0
100
Member Avatar for locy
Member Avatar for Lardmeister
0
149
Member Avatar for raja.geek

hi all, i would like to know the all possible command line options of GGCOV tool... ex:1. ggcov program name 2.ggcov -o dir if anyone of you know this,plz send me the details... Thanks in advance..... RajasekharReddy.B

Member Avatar for Salem
0
117
Member Avatar for aznstyles408

So here's my problem. I need to copy paste two 2d arrays together to form a new one. So in this function I allocate memory for the new array and then I use the memcpy function to start copying. The first copy goes fine. But i am not sure how …

Member Avatar for Salem
0
65
Member Avatar for jaepi

Hello there, do you have any idea where to get a good reference for the function fseek64? Or does anyone of you here knows this function or is there really a fseek64 function? lol. Thanks!

Member Avatar for jaepi
0
1K
Member Avatar for pedro martinez

Hi, I need help to sort a file. I am able to open the file, but the lines of the text file are separate by commas and I have to separate the lines into 4 differents string of characters. I have problems separating the string and sorting them by name. …

Member Avatar for Aia
0
92
Member Avatar for abhi07

a c program to convert lower case text to upper case using strlen (). a c prog to arrange names in alphabetical orderusing strcpy (). a c prog to check wether given number is prime or not. to find length of sring without using library function. to check wether etered …

Member Avatar for ChaseVoid
0
266
Member Avatar for jayasharma

[B] Hi All, I need very urgent help regarding reading tiff file and apply mean filter on it. I will be really thankfull to you if u can provide me C source code. Please help me..... Regards, Jaya Sharma[/B]

Member Avatar for Salem
0
98
Member Avatar for rylix01

I need to write a C library routines to allow user to process images to get different effects like inverting colors and scrolling vertically and horizontally. for inverting colors, we need to write a function- for scrolling vertically and horizontally, we need to write a procedure- and call these function …

Member Avatar for rylix01
0
127
Member Avatar for gallantmon1

I'm still confused with file i/o here and needs a bit of help on fixing the codes I have. Can anyone offer some help? I have two codes here that sort of work together. One is a database type of code that is supposed to get input form the user …

Member Avatar for gallantmon1
0
249
Member Avatar for alex_bhes14

everyone here can give me the code of this sample program.. enter a positive number: 100 your inpit is: one hundred.. i allowed to use the do...while loop.. if every one here who can send me the code of this sample output.. send it to [keep it on the site].. …

Member Avatar for Narue
0
46
Member Avatar for gallantmon1

I want to do a binary tree code that outputs an actual tree, but I'm a little lost right now and don't know what to do. I did this code in Dev C++ Here's the code so far: [code]#include<stdio.h> #include<stdlib.h> #include<string.h> #include<strings.h> #define TRUE 1 #define FALSE 0 int size; …

Member Avatar for Narue
0
149
Member Avatar for restrooms

can someone help me on editing my program. it is a one year calendar and im now stock. and i did;nt put default bec. it will not run. #include <stdio.h> #include <conio.h> int a,b,c; int main() { clrscr(); printf("Enter Number:"); scanf("%d",&c); switch(c) { case 1: printf("\t\t\tJanuary 2007"); printf("\n\t"); for(b=1;b<=51; b++) …

Member Avatar for iamthwee
0
85
Member Avatar for rpjanaka

hi all, i have Theora video codec source code (a C library) and i want to debug it using GDB in linux. but if its developers have not provide debuging enable option, how can i manualy chnaged the make file for unabling debuging optins. please can anyone help me to …

Member Avatar for dwks
0
65
Member Avatar for pdwivedi

I have several .CPP and .H fles which i want to compile together. These files are used for PLC and Oracle database communication. when i try to compile these files it says following header files are missing .. [COLOR=red]<occi.h>[/COLOR] [COLOR=red]<sys/msg.h>[/COLOR] [COLOR=red]<sys/time.h>[/COLOR] [COLOR=red]<sys/stat.h>[/COLOR] [COLOR=red]<signal.h>[/COLOR] How can I recover these files & …

Member Avatar for dwks
0
106
Member Avatar for locy

can spmeone help me with any c compiler avaliable that i can easy download and the keys that i can use for the command.

Member Avatar for dwks
0
148
Member Avatar for bc030400412

Write a TSR program that changes the background color of the screen to red every 5 second and then white next 5 second, And this continues until you press ‘Q’ It should not modify the text displayed on the screen. Hint: 1_ Intercept Keyboard interrupt (0x09H) 2_ Use video text …

Member Avatar for Ancient Dragon
0
284
Member Avatar for FEARmike21

I have been checking on others letter count programs and none so far are like mine so I'm now making my own thread. My assignment, which is due tomorrow! *Yikes* Is for me to make a text file in notepad and then important that to my code. Then, I has …

Member Avatar for Salem
0
170
Member Avatar for winky

Hey all, I am new to C/C++ and this week we just started object oriented C++. Before I dive into it I want to have a good understanding of simulating object oriented programming with C. Anyway, I believe I have doctored the code to where the queue and the Stack …

Member Avatar for Salem
0
121
Member Avatar for eddiekash

i would like some examples of simple c or c++ codes that can shut down a computer like say at exactly 9pm. could anyone give me a sample c code that can pop up on the screen warning that the computer will shut down in 20 minutes.

Member Avatar for ithelp
0
88
Member Avatar for skyah

Hello, I have to write a few programs. I have an attachment of what i have so far. Can anyone direct me in the right direction.

Member Avatar for Narue
0
103
Member Avatar for ba19

hai..can anyone help me on this task...i might need some sample on doing it.TQ Tasks: 1 You are expected to write a program that simulates CPU scheduling algorithms (SJF and SRTF). 2 The program will request the user to set the the number of processes to be selected for execution. …

Member Avatar for stymiee
-1
523
Member Avatar for baberca

#include<stdio.h> #include<conio.h> #define n 20 main() { int d,p; int b,i,n,bt[20],at[20],num; int arr[20]; clrscr(); printf("ENTER THE NUMBER OF PROCESSES: "); scanf("%d",&n); for(i=0;i<n;i++) { gotoxy(10,5); printf("PROCESS: %d",i+1); gotoxy(25,5); printf("BURST TIME : "); scanf("%d",&bt[d]); gotoxy(50,5); printf("ARRIVAL TIME :"); scanf("%d",&at[p]); } gotoxy(29,20); printf("SELECT ALGORITHM"); gotoxy(29,25); printf("\n[1] - SJF"); gotoxy(29,30); printf("\n[2] - SRTF"); gotoxy(29,35); …

Member Avatar for stymiee
1
599
Member Avatar for ksri
Member Avatar for Ancient Dragon
0
161
Member Avatar for mooseguy

I am having troubles with a program I wrote to count letters in a string. Here is the program: [code=C]#include <stdio.h> #include <stdlib.h> #include <string.h> int i; int length; int ascii; char cipher[3]; int letters[26]; int main() { char cipher[10] = "ABC"; /*Or an inputted variable, but that's not important …

Member Avatar for Aia
0
83
Member Avatar for furpacino

i wrote a program with switch statements and now i have to write with while loop the same programram. Please say me where i am worng. my if program: [code=c] char letter ; printf("enter the antibiotic sample >>>>> "); scanf("%c", &letter); switch (letter) { case 'N': case 'n': printf("Perform standard …

Member Avatar for Ancient Dragon
0
159
Member Avatar for Exsiss

I am currently trying to write a program that: [quote]Write a program to count and print out the number of copies of the letter 'e' that are found in a pre-specified string. (By "pre-specified", I mean you should declare and initialize the string right in your program, rather than reading …

Member Avatar for Aia
0
85

The End.