15,551 Topics

Member Avatar for
Member Avatar for swaraj@MT

Friends i've a question to solve... it says,i've to display a menu wer i,ve to open a file and enter a news article..the user is asked to enter keywords for that article.. in 2nd option user can search for a file by inputting dose keywords.. [I]my question is how do …

Member Avatar for Adak
0
211
Member Avatar for yash_shukla

[CODE]#include<conio.h> #include<stdio.h> main() { char name[20]; scanf("%s",&char); if(char=="name") { printf("u entered name"); } else { printf("not name"); } }[/CODE] but it is printing not name when im entering name plzz check for the problem

Member Avatar for Onlineshade
0
121
Member Avatar for amrita111

[CODE]#include<stdio.h> int main() { char ch; if(ch = printf("")) printf("It matters\n"); else printf("It doesn't matters\n"); return 0; }[/CODE] Here according to me, the expression inside "if" will be true becoz we have used "=" sign and not "==" sign. but the output is "It doesn't matters".how is it so?

Member Avatar for Narue
0
220
Member Avatar for Rupindersingh

I was installing Turbo C on my PC and it says "Make sure you insert \TC\Bin into your DOS path". Now how is that done.

Member Avatar for Adak
0
149
Member Avatar for fullarmorzz

[CODE] #include<stdio.h> #include<conio.h> #include<string.h> int x; char name[20]; main() { printf("Exercise no. 10 ESN 211-9A MWF 7:30-9;30\n\n"); printf("Enter your age:\n"); scanf("%d",&x); if (x<18) printf("UNDERAGE!\n\n"); else if (x==18) printf("STUDENT LICENSE POSSIBLE\n\n"); else printf("PROFESSIONAL LICENSE AVAILABLE\n\n"); printf("Enter the result of your drug test: \n"); scanf("%s",&name); if ( name == "positive" ) printf("HOLD …

Member Avatar for Onlineshade
0
123
Member Avatar for murderotica

I don't really know where to post this thread but since my code in creating the firmware is in c, I'll try my luck here. I have an application that basically appends all files (u-boot, kernel, rootfs, etc.) into one bin file which forms my firmware file. I'm having a …

0
56
Member Avatar for damaia

Hi, i would like to know if there is a function in c that allows me to search for a specific character in a file, and how to use it. Thanks in advance

Member Avatar for Adak
0
1K
Member Avatar for shanki himanshu
Member Avatar for sharathg.satya
0
136
Member Avatar for SHENGTON

I got some problems with my program here. There are lots of lacking in my code. Hope you can help me with this guys. I'm still a student. Here's the problem: A program that prints figures of (*): 1. Displays a menu [1] Figure 1 [2] Figure 2 [3] Figure …

Member Avatar for Adak
0
496
Member Avatar for ray-solomon

This program I wrote is supposed to restart tor, wait 5 seconds, then look for a PID number using regex. It compiles and runs fine but the regex logic never displays "good". I'm confused. [CODE]#include <sys/types.h> #include <regex.h> #include <stdio.h> #include <string.h> // gcc -o tor_restart tor_restart.c // chown root …

Member Avatar for ray-solomon
0
170
Member Avatar for Ich bin würdig

Can someone help me to create a syntax for a christmas tree... (the christmas tree must be like the shape of a true to life one) thanks.

Member Avatar for Adak
0
231
Member Avatar for Demetrio.pepi

Hello. My whole code is bellow and I getting the error message: {"responseData": null, "responseDetails": "Suspected Terms of Service Abuse. Please see http://code.google.com/apis/errors", "responseStatus": 403}. Do you have some suggestion? [CODE]#include <fstream> #include <vector> #include <iostream> #include <sstream> #include <string> #include <stdio.h> #include <stdlib.h> #include "/usr/include/curl/curl.h" #include "/usr/include/curl/easy.h" size_t write_data(void …

0
73
Member Avatar for theju112

[code] #include<stdio.h> typedef struct node { int data; struct node * link; }n; void addatbeg(n *); void display(n *); n* first=NULL; int main() { int ch; printf("%u",first); while(1) { printf("\n enter 0 to terminate else any other key"); scanf("%d",&ch); if(ch==0) break; addatbeg(first); } } void addatbeg(n* first) { int ele; …

Member Avatar for Narue
0
120
Member Avatar for starkk

segmentation fault...:( some one help me pls.. [CODE]#include<stdio.h> #include<stdlib.h> #include<string.h> int main() { char a[50]; char *x[10]; int i,j,n; char *temp; printf("enter the no of strings:"); scanf("%d",&n); for(i=0;i<n;i++) { printf("enter the string:"); scanf("%s",a); x[i]=(char *)malloc((strlen(a)+1)*sizeof(char)); if(x[i]==NULL){ printf("malloc not done"); exit(1);} strcpy(x[i],a); } for(i=0;i<n-1;i++) { for(j=0;j<n-i;j++) { if(strcmp(x[j],x[j+1])>0) { strcpy(temp,x[j]); strcpy(x[j],x[j+1]); …

Member Avatar for starkk
0
454
Member Avatar for .:Pudge:.

I have been trying to support certain built in commands such as 'cd' and 'help'. If I do 'ls' or 'mkdir' it executes them fine and they do what they are supposed to. If I type the command 'help' I get a segmentation fault and if I type 'cd' it …

Member Avatar for nezachem
0
206
Member Avatar for now how abt tht

please help me understand when does one use *n=m and when to use n=&m [code]int *n,m; *n=5; m=2; *n=m;[/code] //gives an error

Member Avatar for jnawrocki
0
134
Member Avatar for D33wakar

I'm Using [ICODE]fwrite[/ICODE] to print the contents of a sturcture in a file. [CODE] #include <stdio.h> #include <stdlib.h> struct com{ int code; char* name; }; int main() { struct com py[2]={{21,"Monty Python"}, {22,"Python lang"} }; FILE * fp; if((fp=fopen("data.txt","w+"))==NULL) exit(1); fwrite(&py,sizeof(struct com),1,fp); /*int i; for(i=0;i<2;i++) fprintf(fp,"code:%d,name:%s\n",py[i].code,py[i].name); */ fclose(fp); return 0; …

Member Avatar for Narue
0
113
Member Avatar for Rupindersingh

I was trying the following TSR which is supposed to capture interrupt no.8 and change screen color every 10 seconds. But either the linker shows a "not enough memory" error, or, nothing appears to happen. Also the program does not seem to be entering the function our(). Please help... [CODE]#include …

Member Avatar for Adak
0
432
Member Avatar for Mahesha999

Hi there, I am not able to visualize what this code exactly creates in the memory, though I can understand that this is array of pointers: char *dic[][40] = { "atlas", "A volume of maps.", "car", "A motorized vehicle.", "telephone", "A communication device.", "airplane", "A flying machine.", "", "" /* …

Member Avatar for Mahesha999
0
143
Member Avatar for 1150

Can anyone help? New programmer trying to write Program that prompts user to enter name of file to display on screen. User is given to option to display another file until the user ends program. it is not working and. After compilation when 1 is chosen it scroll the question …

Member Avatar for Adak
0
116
Member Avatar for Anuradha Mandal

[B]Input[/B] The input begins with two positive integers n k (n, k<=10^7). The next n lines of input contain one positive integer ti, not greater than 109, each. [B]Output[/B] Write a single integer to output, denoting how many integers ti are divisible by k. my code is......... [CODE] #include<stdio.h> int …

Member Avatar for Narue
0
89
Member Avatar for shadowscape

Hello, i have created a Xor function for a DLL i am developing. I have a problem with this function as the decoded text isn't matching its original state and i am unsure as to the cause of this, please could you help me? [CODE] #define export __declspec (dllexport) #include …

Member Avatar for nmaillet
0
128
Member Avatar for Gaiety

Hi, if any one has any idea "how the switch statement works". does it maintain any tables internally or any other machanism? and is there any way to make the switch statement efficient?

Member Avatar for lyfzopen
0
189
Member Avatar for amrita111

main() { char *p = “ayqm”; printf(“%c”,++*(p++)); } how will it work?please explain..

Member Avatar for jnawrocki
0
99
Member Avatar for sydsine

plz solve ... [CODE]int main() { const int m=10; int &n=m; n=11; printf("%d%d",m,n); }[/CODE] can w declare &n...its not an error...

Member Avatar for himgar
0
326
Member Avatar for bubbinos

Here's what I'm trying to do. I'm making a program that uses an array to store a deck of cards. I have other code written that converts a number between 1 and 52 into numbers and suits. My only issue is that my code to randomly put numbers into the …

Member Avatar for Adak
0
215
Member Avatar for rom.

I'm just starting out in C/C++, and I want to make a simple socket server script. It will be compiled on mac/linux and executed from terminal. Just want a simple script that will: - allow multiple clients to connect to the server on a specified port (they will be using …

Member Avatar for rom.
0
399
Member Avatar for cse.avinash

Can any one help me to know how to deal with big numbers, like to count the number of digits in factorial of 5*10^9. or how to make number 20,000 decimal. array can store only to 10^6, if heap is taken the size could extend up to 10^9.How to deal …

Member Avatar for TrustyTony
0
280
Member Avatar for D33wakar

I am trying to write a program for searching strings(one at a time)in a text file. To start things off, I wrote this one. [CODE] #include <stdio.h> #include <string.h> #include <stdlib.h> #include <ctype.h> int main() { FILE *txt_file; int chr;/*char read by fgetc*/ int word_match=0; const char* substring ="window";/*search word*/ …

Member Avatar for Narue
0
231
Member Avatar for coder_naive

I wrote this simple code in devc++. On compiling, the computer is showing syntax error at line int P = rand(); ... while the same line, if I write in the main function gets compiled easily. Please tell me what's going on! [CODE]#include <stdio.h> #include <stdlib.h> #include <math.h> struct poclick …

Member Avatar for coder_naive
0
159
Member Avatar for mullan123

after tokenising my string i am the tokens to the method below and counting the tokens. if token number is one, that means i have one command only and pass it from execvp.. if i have a second token then pass that token from the second execvp.. This gives me …

0
109
Member Avatar for h.senan

Hello Guys! I am suffering with xcode compiler while i am compiling the below code. At first the problem was on getch( ) and ungetch ( ) , then I have been advised to use getc/fgetc Now the error massage is: error: expected identifier or '(' before '{' token Thank …

Member Avatar for Narue
0
515
Member Avatar for Museless

I am trying to find out how to replicate the output of fwrite("andbe", 4, 1, output); an encryption algorithm I am using writes its output as this, but I am sending data across a network, and need to be able to write this to a string to send. The algorithm …

Member Avatar for thines01
0
169
Member Avatar for kooletz

i have an assignment to create a program. Mang Tomas paid a certain amount of Bushels of wine to be delivered this weekend for his promotional party. What will the rate of each Bushel of Beer and how much dicount will be given to them? [CODE]Number of Bushels Discount 1 …

Member Avatar for gusano79
0
173
Member Avatar for Uma_CSPL

I am opening a file in read mode and reading continuosly after a time interval from 9AM to 4PM. Two problems exist: (1) Few lines from the file have been missed for certain time interval alone, able to read the contents after the missed lines. (2) Continuously checking the file …

Member Avatar for Anuradha Mandal
0
108
Member Avatar for KOFguru

I am having problem with `clrscr' undeclared (first use this function) (Each undeclared identifier is reported only once for each function it appears in.) when I am compiling it in DEV-C++ .....please let help me with these [CODE]#include <stdio.h> #define p print f #define s scan f main() { int …

Member Avatar for ashwin k v
0
213
Member Avatar for Jamblaster

First off let me say that I am a student and do not want any answers. What I do want is some help understanding why my logic isn't working so I can devise a new plan. Any help at all would be greatly appreciated because I am completely stuck atm …

Member Avatar for Anuradha Mandal
0
213
Member Avatar for dotancohen

Many functions in C have been "improved" with versions that have n, l, or other characters in their names. For instance, strncat and strlcat which improves strcat. What is the significance of the letter n or l in these names? Thanks.

Member Avatar for dotancohen
0
131
Member Avatar for pinkannu

I have a very big string "-dAwin Main_Window -dwin Widget_Window -dh 500 -dw 300 -da 100 -dv 10 -dint 2............" This string gives me input parameter for running my application.Example -dAwin Main_Window gives me application window name. -dAwin is identifier b'coz this sequence may change or number of parameters may …

Member Avatar for pinkannu
0
193
Member Avatar for ineedsomehelp:3

Ok, I have a program that gets the factors of a LCD of a number (recursion). I need help converting it to loop statement :( . Any help will be appreciated. and please add an explanation I would really appreciate it. [CODE]#include<stdio.h> #include<stdlib.h> void whatIs (int nNum) { int nF …

Member Avatar for Adak
0
126
Member Avatar for lastbencher

Hi I installed Visual C++ 2010 express today. There is no option to create a .C file. I tried googling but found nothing. Please help me with this

Member Avatar for mitrmkar
0
309
Member Avatar for Mahesha999

Hi this program accepts the string from the input. I cannot understand the highlighted format specifier. Please help me understand. [CODE]#include "stdafx.h" using namespace std; int _tmain(int argc, _TCHAR* argv[]) { char str[15]; scanf("[B]%[^\n][/B]",str); str[0]=toupper(str[0]); str[15]='\0'; printf("%s",str); putchar(123); getch(); return 0; }[/CODE]

Member Avatar for Adak
0
147
Member Avatar for digitalhead

Hi, I wanted to write a C program which searches for text files in a directory(assuming the directory and files are not write protected),list them and open each one of them(files) write a letter A in them.Can anyone give me a sample code. I believe it can be done with …

Member Avatar for ashok.bandari88
0
220
Member Avatar for hqt

I have two declare of pointer: [code] Pointer *a,*b,*c; int i=5; *b=i; a=b; c=&b; [/code] at line (a=b) mean a will point to what b point (mean point to int i) at line (c=&b) mean c will have address of b, mean c will be pointer to pointer b. So, …

Member Avatar for keshvari
0
142
Member Avatar for reza.adinata

Hi all, I am a newbie in C, and a bit curious with this "goto" statement. For instance, I create a simple code below [CODE] #include <stdio.h> int main () { int a; a = 1+1; if (a!=2) { goto error; } error: printf("error is here\n"); return 0; } [/CODE] …

Member Avatar for reza.adinata
0
185
Member Avatar for keshvari

Hello I write program that can solve linear equations with LUP decomposition method.I know that my algorithm is true and every part of my program do what I want. when I call function lupDecomposition() inside the lupSolve() the program crash.This is my related code: [CODE] int makeUpperDiagonal(Matrix * src){ int …

Member Avatar for keshvari
0
131
Member Avatar for hqt

I have something that I don't know how to use the Pointer, this is my code: [CODE] struct node{ int data; struct node* next; } struct node* BuildWithLocalRef() { //give a list with: 1 2 3 4 5 //and your work is import this list in to Linked List with …

Member Avatar for Narue
0
165
Member Avatar for theguitarist

Hello I am very confused with how negative numbers are represented in binary form. They say it is done in 2s complement form. Now won't this 2s complement of a negative number clash with an actual +ve number having the same binary representation? And negation of a +ve number..... We …

Member Avatar for Narue
0
163
Member Avatar for Efficience

I have written this C code in which I'm declaring a variable inside switch body with initialializing it to 10.But when I'm running this code it is printing some garbage value. [CODE]#include <stdio.h> int main() { switch(2) { int x=10; case 1: printf("Case 1: %d\n",x); break; case 2: printf("Case 2: …

Member Avatar for Efficience
0
459
Member Avatar for techie929

Hi, I am trying to read a text file and tokenize the data and store in a character array. [code] #include<stdio.h> #include<stdlib.h> #include<string.h> //#include<file.h> int main(int argc , char *argv[]) { printf("No of arguments %d \n",argc); printf("Argument no 1 is %s \n" ,argv[1]); FILE *fp; char buffer[11]; char *bp; char …

Member Avatar for thines01
0
100

The End.