15,555 Topics

Member Avatar for
Member Avatar for tubby123

i have a doubt. why cannot we use clrscr() before initializing a variable in C? i mean, why wont this work ? void main() { clrscr(); int a,b; ---- ---- getch(); } It'll give an error saying , "Declaration is not allowed here " Logically speaking , you should be …

Member Avatar for Narue
0
141
Member Avatar for madmhan84

[B]Good day everyone,[/B] Hope you could help me on this one The program is running but the result is far from what I want please help me... TIA Like this one: [B]Input:[/B] ------------------------------------ Enter first number: 7 Enter second number: 45 ------------------------------------ [B] Output:[/B] ------------------------------------ 7.45 [B]7.00[/B] ------------------------------------ [B]which should …

Member Avatar for Ancient Dragon
0
122
Member Avatar for wonkerloop

I have tried to make a program that allows inputs into a 1D array. I run the program and the inputs are asked for, but the program simply continues to ask for more inputs. I'm moderately new to C so go easy. Any help would be appreciated Cheers Wonkerloop Heres …

Member Avatar for yashsaxena
0
164
Member Avatar for lochnessmonster

how would i assign the following functions address to a function pointer? int sum(int x, int y) { ... }

Member Avatar for abhimanipal
0
57
Member Avatar for maybnxtseasn

typedef struct _FOO { int blah; int blah2; int blah3 } FOO, *FOO; 1.) Does this create 2 objects of type FOO and another that is a pointer to a FOO? 2.) OR does it just typedef the names so you don't have to do the following struct __FOO fooStruct; …

Member Avatar for abhimanipal
0
106
Member Avatar for rEhSi_123

Hi Guys, I need some advice on reading an integer from a file. The file would always have one integer. Once the integer is read in, I would use this in 'if else' statement to find the outcome [CODE]f = fopen (fileName, "r"); if (f == NULL) return 0; fread(); …

Member Avatar for rEhSi_123
0
81
Member Avatar for Anark10n

Apologies if this question has been asked before, but all other threads are so old that it was advised to start a new thread. As the title suggest, i'm having trouble linking files in Code::Blocks(Linux OS). I had the same problems back when i was using Windows. Error message is …

Member Avatar for Anark10n
0
2K
Member Avatar for gayansameera
Member Avatar for saqib

hi guys , what i am trying to do is ,to take a word as input from user and reverse its order like world into dlrow and tell the user that the word is same or not after reversing its order Here is the code please check it cause it …

Member Avatar for arjunpk
0
204
Member Avatar for Markmit

In the book C Primer Plus, Fifth Edition, in Chapter 10. Arrays and Pointers: C guarantees that, given an array, a pointer to any array element, or to the position after the last element, is a valid pointer. But the effect of incrementing or decrementing a pointer beyond these limits …

Member Avatar for yashsaxena
0
840
Member Avatar for dashure

I am doing a project now in school, and i really need help!. its goes like this: I have 1000 triangles in a file..did it already (its a struct)every triangle has 3 points and its binary catalog number. I have space in memory only for 200. in this file every …

Member Avatar for TrustyTony
0
148
Member Avatar for madmhan84

-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- Please help me... [B]Sir/Ma'am I think I got this one working using this code [U]but I have one problem[/U]: this is the code:[/B] [CODE] #include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> void main() { FILE *fp; char code[80],code2[80], ename[80]; int elevel; clrscr(); if((fp = fopen("samplete.txt","r"))==NULL) { printf("cannot open file.\n"); } printf("Enter …

Member Avatar for WaltP
0
227
Member Avatar for NickJoe

I was given a project in my CSSE class that has to do with signals and handlers. After spending the last 48 hours stressing and cursing the lack of proper information (that I could find) on the Internet to help me understand, I decided to turn here once more. THe …

Member Avatar for NickJoe
0
289
Member Avatar for wdearth

I'm working on a program that's supposed to generate a 40 character random string of uppercase letters A-Z, then generate a random replacement string of random uppercase letters A-Z of length between 2 and 20. It displays the 40 character string, but when I enter the length of the replacement …

Member Avatar for arjunpk
0
163
Member Avatar for zaraki

[CODE]/* this code attempts to generate a sudoku board in an non graphical envoirnment the code compiles fine but however it throws segmentation fault everytime it's run*/ # include<stdio.h> # include<stdlib.h> # include<time.h> static int baseArray[9][9]; static void initialise(); void display(); static int checkPosition(int row, int col, int value); int …

Member Avatar for zaraki
0
194
Member Avatar for fifouta

Hello, I want to sort array by using" the quicksort algorithm" so here is the code: [CODE] #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <pthread.h> void *triHoare (void * arg); int PivotSelection (int indexStart, int indexEnd); int Split (int tab[], int pivot, int indexStart, int indexEnd); int MAXTAB; …

Member Avatar for abhimanipal
0
171
Member Avatar for drongo

Hi, Im undergoing a project at the moment and have stumbled onto an error which a could solve nor understand even with google help... So, the C program Im making is suppose to sort an array of surnames into alphabetical order, also the user can use the menu to pick …

Member Avatar for drongo
0
147
Member Avatar for darkdai

hey guys, i have to develop a program which will search for files using their names and extension as an option. any idea of how to start or what do i need to know. thanks in advance.

Member Avatar for WaltP
0
94
Member Avatar for gayansameera

My project want to write tokenizer which can able to tokenize input C code (already written C file input to the system) and identify what are the keywords, variables, comments, conditions etc. (all syntax provide by C). any one can help me to do this.

Member Avatar for gayansameera
0
184
Member Avatar for shima.khanehzar
Member Avatar for kayhantolga
-1
83
Member Avatar for ak24

Hello. I'm learning C with "The C Programming Language" book, and I'm trying to solve exercise 1.13: "Write a program to print a histogram of the lengths of words in its input. It is easy to draw the histogram with the bars horizontal; a vertical orientation is more challenging." I …

Member Avatar for ak24
1
374
Member Avatar for cppgangster

Hi started learning c from book "let us c". I noticed that I can't find string unformated functions such as putch,putche or stricmp? Are these funtcion are part of standart?

Member Avatar for abhimanipal
0
127
Member Avatar for quartaela

hi there i am trying to build a linked list from read a file operation. this code only adds the first node to the list. the problem is i am facing with "error: request for member 'head' in something not a structure or union" error. i call add_Node function in …

Member Avatar for abhimanipal
0
442
Member Avatar for cestra

[COLOR="Red"][B]//This is the main file[/B][/COLOR] [CODE]#include<iostream> #include<fstream> #include<string> #include "Books.h" #include"account.h" using namespace std; int main() { cout << "\tWelcome\t" <<endl; cout << "1-Login" <<endl; cout << "2-Register" <<endl; cout << "3-exit" <<endl; cout << "Please enter a choice: "; cin >> choice; switch (choice){ case 1: system ("cls"); cout …

Member Avatar for cestra
0
203
Member Avatar for moshiurbest

i want to make a game where different player can join.this is as like a dice game.first time numbers of player can join,after joining the game will start.the game will continue up to 5 or 6 round.after that highest scorer will be declared as a winner, one thing i like …

Member Avatar for kiranroy
0
85
Member Avatar for javarook

I have to ask the user a question on what number they would like to search for in the list. The code compiles fine but when I run it, nothing shows up for the user to ask a question. here is the code: [code]#include<stdio.h> #include<stdlib.h> struct Node { int data; …

Member Avatar for Ancient Dragon
0
169
Member Avatar for gruffy321

hi all and thanks for reading. Personally i thought i wouldnt be in the frame of putting up one of my assignments, as i can see where an opinion might be formed, over me trying to pull as fast one and get someone to code this for me etcetc etc..... …

Member Avatar for WaltP
0
221
Member Avatar for gruffy321

Hi all, hope someone can help here, i cant seem to get this to compile. maybe im tired and have not looked at it, but its a bit like blind leading blind etc, meaning not sure what the error is referring to, i have enclosed an attachment image of the …

Member Avatar for gruffy321
0
159
Member Avatar for cppgangster

Hi how to access standard input buffer to get 1 and second character from there? for c++ there is a function named peek() but in c libraries I can find one...

Member Avatar for Ancient Dragon
0
149
Member Avatar for iorisendoh

hi can someone help how to make a program or exampel of program using two dimensional array. Or can someone help me to make program by this problem >Write a program using two dimensional array that searches a number and display the of times it occurs on the list of …

Member Avatar for gruffy321
-2
313

The End.