18,491 Topics

Member Avatar for
Member Avatar for meli1

Heya i ran into a little problem, well more of a mental dilemma using strtok(), i already know how this function works, heres an example code: [CODE] void split_me(char *input) { char *split = NULL; //reset split size_t len = strlen(input); char to_array[len]; int i = 0; split = strtok(input, …

Member Avatar for meli1
0
165
Member Avatar for FELIGO

My Console Application window can't display letters from other alphabets(e.g russian) when I run the program. It's just displaying question marks in place of them. Please help if you can.

Member Avatar for arunkumars
0
201
Member Avatar for venus87

[CODE] #include<stdio.h> #include<conio.h> void main() { int a; a=10, // in this line instead of ; i used , printf(" The value of a is =%d", a); getch(); } [/CODE] In the above program instead of using ; i used , but the compiler is not showing any error and …

Member Avatar for Ancient Dragon
0
184
Member Avatar for Daniel85

***I have a feeling that there might be something wrong with my function int fgetAnswers(int*pos, char res[], FILE*inp); I am able to compile, but the problem is that wherever the black screen appears, a box would pop out saying that the program has stopped working. Can any of you guys …

Member Avatar for Daniel85
0
184
Member Avatar for Daniel85

Is there anything wrong with my coding? Why do I keep getting the message..."Error Opening Input File!" #include <stdio.h> #include <conio.h> void fgetAnswers(FILE*,int*,char[]); void fgetAnswers2(FILE*,int*,int,char[]); int main() {char ans[50],choices[50]; int n,i,id,missed[50],tot; FILE *input,*output; input = fopen("examdat.txt","r"); if(input == NULL) { printf("Error opening input file!\n"); getch(); return 0; } fgetAnswers(input,&n,ans); output …

Member Avatar for Daniel85
0
248
Member Avatar for hszforu

I am using turbo c. I have a 2mb text file "tryy.txt" , so what i am trying to do is ,i am scarping the urls from the text file and saving it into another file. Now, after running the program, i get a meassage as "Null Pointer Assignment" on …

Member Avatar for WaltP
0
119
Member Avatar for Adnan671

So, it sorts the books by price just fine, but I cannot get it to sort the books by title. I am most likely over thinking this, but I've spent a couple hours trying to figure it out. I've looked online and couldn't find the answer. I'm guessing the problem …

Member Avatar for raptr_dflo
0
3K
Member Avatar for lilsancho

Hi Everyone Hope you are all well. I've been tasked with an assignment at collage to create an employee management system, so far i've done well and managed to create a working program which i am happy with :) However there is an optional function that can be created that …

Member Avatar for lilsancho
0
174
Member Avatar for Radi0ShacK

Hi all, I just wanna know how to send a file through a socket connection in C language "client request a certaion file on server and server send him this file" i work on both winsockets and bsd sockets "client ==> windows, server ==> *nix" Thanks alot :)

Member Avatar for MaSSaSLaYeR
0
537
Member Avatar for ArmanUV

I am buiding a Tic Tac Toe solving robot using the LEGO NXT kit for my school project. For practise, I wrote a Tic Tac Toe game using the minimax algorithm which worked very well. When I wanted to port my code to NXT, I found out that none of …

Member Avatar for Adak
0
1K
Member Avatar for MemphameHeroic

I need help in making a C program that performs binary operations on two 16 bit binary values. It should look like this: Select operation (1) Addition (2)Subtraction Enter Choice: 1 Enter First binary number: 1111111111111110 Enter Second binary number: 0000000000000001 Sum: 1111111111111111 I have trouble using the functions, please …

Member Avatar for Adak
0
268
Member Avatar for akde

I have created a new C++ project (to be able to use the graphics.h library) then I have tried to add a C project which works perfectly in C (by the way I have saved the file with .c extension). 2 line leads to error: [CODE] q = malloc(sizeof(struct QueueRecord)); …

Member Avatar for akde
0
286
Member Avatar for janet@123

i am receiving a struct from the switch: [CODE]/* Packet received on port (datapath -> controller). */ struct ofp_packet_in { struct ofp_header header; uint32_t buffer_id; /* ID assigned by datapath. */ uint16_t total_len; /* Full length of frame. */ uint16_t in_port; /* Port on which frame was received. */ uint8_t …

Member Avatar for janet@123
0
297
Member Avatar for CityThrille

Good day everyone. I am back from some previous months of extensive schoolwork. I am creating now a payroll application, but I think there's something wrong in my code, because it created an output that's not my intended output. Wait, guys, I'm confused. Is this appropriate for a C forum …

Member Avatar for CityThrille
0
309
Member Avatar for pnoylover

can anyone help me get an idea on how to add or subtract numbers in linked list for example i input the number 1,3,5 in order the display will 135 then i input the plus sign(+) then the input will 45 it will always add the 1st and 2nd number …

0
70
Member Avatar for amnakhan786

i am writing a code which is as follows: [CODE]#include <stdio.h> int main(void) { char buffer[2500]; FILE * myfile; myfile = fopen("/home/csgrads/akhan015/desktop/benchmark/coverage/test0/stmt.txt","r"); while (!feof(myfile)) { fgets(buffer,2500,myfile); printf("%s",buffer); } fclose(myfile); return 0; }[/CODE] 1.in this code i am accessing a folder to read a text file. this test0 folder is only …

Member Avatar for Rashakil Fol
0
202
Member Avatar for coding101

Im having trouble connecting my sockets. On one computer I have a java server socket running and on the other computer i have a c socket client trying to get the message from the other computers server. But I cant get them to connect. Do you see an error with …

Member Avatar for nezachem
0
167
Member Avatar for jerox

Hey guys, I am new to programming in C, I am trying to save "tc" into a variable using for loops. I understand for integers, multiply the result by 10. Is there a similar way to do this for chars? For integers, [CODE=C] for(j = 0; j < i; j++) …

Member Avatar for jerox
0
154
Member Avatar for mikedee7282

Can someone interpret this code for me? I dont understand whats going on. This code is supposed to take a number n that is inputted and show all the numbers below n that are frugal. A little background, a frugal number is a number where the amount of the digits …

Member Avatar for stereomatching
0
291
Member Avatar for terence193

This is what the question is asking: Write a program to get the user to enter a positive number. Validate the input so any negative or zero number entered is rejected and the user is to re-enter the number. and this is what i have done [CODE]#include<stdio.h> int main (void) …

Member Avatar for YAMNA MIDHAT
0
227
Member Avatar for pkrai

[CODE]#include<anil_pkr.h> void main() { menu();getch(); } /* header file- #include<iostream.h> #include<conio.h> #include<dos.h> #include<string.h> #include<ctype.h> #include<stdio.h> #include<stdlib.h> ////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// int i,j,k,l,x=5,y=5; char n; void smallbox(int,int,int,int,int); void smallbox(int col,int x,int y,int len,int brth) {textcolor(col); gotoxy(x,y+brth);cprintf("%c",192); for(i=1;i<len;i++){gotoxy(i+x,y);cprintf("%c",196);} for(i=1;i<len;i++){gotoxy(i+x,brth+y);cprintf("%c",196);} gotoxy(len+x,y);cprintf("%c",191);gotoxy(len+x,brth+y);cprintf("%c",217); for(i=1;i<brth;i++){gotoxy(x,y+i);cprintf("%c",179);} for(i=1;i<brth;i++){gotoxy(len+x,y+i);cprintf("%c",179);} gotoxy(x,y);cprintf("%c",218); } /////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// void paint(); void paint() { for(i=1;i<75;i++){textbackground(15); gotoxy(3+i,19);cprintf(" "); …

Member Avatar for Ancient Dragon
0
131
Member Avatar for abshah

Hi, I am facing a bit of issue in writing a network software. When I try to send or receive a struct that contains a data type of 8 bytes the next sent or received struct is somehow affected. I have a few things in mind but first I wanted …

Member Avatar for abshah
0
499
Member Avatar for gary91
Member Avatar for express690

I'm having trouble writing an array program that deletes duplicate numbers in an array. I can't figure out the code for find the array size. I have the array max set to 25 but my array doesn't have 25 numbers in it. (let's say it only has 10 numbers in …

Member Avatar for WaltP
0
377
Member Avatar for gnomelook

Help!! How to print this using loop & condition starements... 0 1 1 1 1 -1 0 1 1 1 -1 -1 0 1 1 -1 -1 -1 0 1 -1 -1 -1 -1 0 help pls..asap...

Member Avatar for gnomelook
0
156
Member Avatar for libathos

Is there a way i can modify the Bresenham circle algorythm in a way so that it actually draws arcs with specified start and end angle instead of complete circles? the algorythm in c is like this [CODE]void DrawCircle(int xM,int yM,int radius) { int f = 1 - radius; int …

Member Avatar for Adak
0
213
Member Avatar for lscamaro

I'm writing a pig latin program and am having problems moving onto the next word and printing the words. I have to print from the first vowel onto the end of the word and then from the beginning of the word to the first vowel including the vowel itself. [CODE]#include …

Member Avatar for YourGamerMom
0
513
Member Avatar for Dakot

hello , i made a election program , here it is [CODE]#include <iostream> #include <cstdlib> #include <string> #include <conio.h> #include <iomanip> #include <fstream> using std::ofstream; using namespace std; string users[4]; char choice2; int votes[100] = {0}; int choice; int totalVotes=0; void votes1() { cout<<"Voting! : "<<endl; cout<<setw(21)<<left<<"(1) To vote " …

Member Avatar for StuXYZ
0
207
Member Avatar for amnakhan786

description of the program: 1. first i have to input a folder A by giving full filepath. this folder contains a benchmark program tcas.c, a text file universe.txt which contains 1500 lines, each line is a test case giving 12 arguments to the benchmark program, which are used to test …

0
144
Member Avatar for collinskawere

how can i create something of this sort: * *** ***** ******* ********* ******* ***** *** * this is my source code: #include <stdio.h> int main() { int i; i = 1; while(i <= 5) { printf("*\n"); i++; } getchar(); }

Member Avatar for collinskawere
0
190
Member Avatar for triumphost

Hi guys. I have a php script that reads some values off a website and prints to a file every second.. The thing is, the script is always ran in my browser and I don't like that. I want to write a c++ program that can run that script within …

Member Avatar for thines01
0
394
Member Avatar for ram619

This is a piece of code from some book. According to book, this code must not have worked and should have given a error message saying "cannot convert parameter 1 from 'const char[15]' to 'char*'" but this code is running on turbo C giving just a error message of const …

Member Avatar for ram619
0
219
Member Avatar for cluekiller

I'm Jay. - 19 years old - Freshman, majoring in Computer Science. - Know C and some little Java. I'm from Bangkok, Thailand. Any asian, here :P?

Member Avatar for Pseudo Coder
0
208
Member Avatar for timetraveller92

This code is done using C. Whole point of it is to remove the name just before the first hyphen. Its blindly written so I haven't improved it and it has extra variables and no reuse of variables to save space. If anyone can just locate the error why the …

0
153
Member Avatar for amnakhan786

i got an assignment regarding testing, i have to write a c code and compile in linux. the question is as found at: [url]http://www.cs.ucr.edu/~linc/cs206/project/index.html[/url] please suggest, i have no idea to start

Member Avatar for WaltP
0
207
Member Avatar for ram619

Can you please tell me how is the processing of this code taking place. Because its giving a fixed address same as mentioned in the book. The Answer to this question is Address of i=FFE4 value at ptr =10 Address of j=FFE2 value at prt=20 how come addresses are these, …

Member Avatar for ram619
0
176
Member Avatar for gaza331

help me in this project plesae see Attach File [QUOTE]#define TRUE 1 while(TRUE){ //repeat forever type_prompt(); //display prompt on the screen read_command (command, parameters); //read input from terminal if(fork()!=0){ //fork off child process waitpid(‐1, &status, 0); //wait for child to exit } else{ execve(command, parameters, 0); //execute command } } …

Member Avatar for Member #114542
0
164
Member Avatar for dhsn

I would like to find a c compiler for windows 7. So far I have tried 3 and all get the message that "this program is incompatible with windows". Any suggestions? dhsn

Member Avatar for nilay2141992
0
337
Member Avatar for empyrean

Hi I am trying to run this C code in Visual Studio along with a set of Cpp files. It gives the below errors error 2143 : syntax error : missing ')' before '&' error 2143 : syntax error : missing '{' before '&' error 2059 : syntax error : …

Member Avatar for gusano79
0
293
Member Avatar for Zssffssz

Well I want to make a DLL but all of the tutorials online seem to focus tword GUI programing or go a little too fast. Can anyone explain it? As far as I have seen it's syntax resembles resource files. And what makes it a '[I]Dynamic[/I] Link Libray' as in …

Member Avatar for mike_2000_17
0
356
Member Avatar for Adam508

I am currently a student at USF. I transferred here in Fall of 2010 from a local CC with an AA degree. This is the start of my second year at USF as a declared CS major. I have only taken 2 programming classes. Java and C (currently in C). …

Member Avatar for Adam508
1
538
Member Avatar for achava

Using a C but not a C++ compiler. We have code like this: Suppose we have code like this: [CODE]main() { int *funcko(); int *george = funcko(); printf("%d", goerge[3]); } int *funcko() { int cat[12]; return cat; }[/CODE] What happens when you try this according to the actual rules of …

Member Avatar for Narue
0
168
Member Avatar for Member #920939

Hello World! i wrote this code for fliping the array , but it doesn't work ... why can anyone say me ? what i did wrong? [B]array[/B] and [B]i,n[/B] variable are already global declared. [CODE] void exb(void) { int aux; for(i=0;i<(n-1)/2;i++) { aux=x[i]; x[i]=x[n-1-i]; x[n-1-i]=aux; } } [/CODE] thanks :)

Member Avatar for Adak
0
377
Member Avatar for swissknife007

[CODE]void quick(int a[],int m,int n) { int k,key,i,j; if(m < n) { k=(m+n)/2; swap(a[m],a[k]); key=a[m]; i=m+1; j=n; while(i<=j) { while((i<=n)&&(a[i]<=key)) i++; while((j>=m)&&(a[i]>key)) j--; if(i<j) swap(a[i],a[j]); } swap(a[m],a[j]); quick(a,m,j-1); quick(a,j+1,n); } }[/CODE] I am getting a segmentation problem in swap(a[m].a[k]); Please explain.

Member Avatar for Adak
0
160
Member Avatar for ooops.789

hello....i am trying to implement a client/server socket program in C to display the files available on the server to the client....how do i do this???

Member Avatar for L7Sqr
0
84
Member Avatar for ooops.789

hello....i am trying to establish a communication between server and client and later to do some communication between them, so first i am trying to establish communication and i see that server gives "segmentation fault" as the output. I am placing the code below, check it out and let me …

Member Avatar for ooops.789
0
3K
Member Avatar for shaneos

I'm writing a code to put names in alphabetical order. The code i've written wont compile as its teling me that 'left operand needs l value'. The lines it refers to is where i'm trying to swap around strins using pointers. I could use some help with this, thanks! [CODE] …

Member Avatar for Smeagel13
0
129
Member Avatar for mesanda

hi, i need a help for making double link list program in C double link list (file.h and file.c) in prototype insert first, insert after, insert last, delete first, delete after, and delete last. this program required in hospitaL you can email me : <email removed> (zip) i need for …

Member Avatar for mesanda
0
105
Member Avatar for karisma

Can ne1 pls help with how to subtract two large integers stored as an array. i need to do the same for calculating the jacobi symbol. thanks :)

Member Avatar for WaltP
0
447
Member Avatar for indrajeet6

[B]Hi I would like some helpful hints on how to make a program to: 1)Create a Binary tree 2)Traverse said tree in Preorder form. Thank You [/B]

Member Avatar for suyash_iiit
0
231

The End.