15,552 Topics
| |
how would i assign the following functions address to a function pointer? int sum(int x, int y) { ... } | |
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; … | |
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(); … | |
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 … | |
| |
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 … | |
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 … | |
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 … | |
-------------------------------------------------------------------------------- -------------------------------------------------------------------------------- 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 … | |
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 … | |
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 … | |
[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 … | |
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; … | |
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 … | |
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. | |
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. | |
Hi everybody plz help me to find a simple code of snake game in c! so tnx | |
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 … | |
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? | |
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 … | |
[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 … | |
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 … | |
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; … | |
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..... … | |
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 … | |
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... | |
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 … | |
Basically i want this function to update the records in the file, but it should first prompt for the name of the employee and then retrieve the employee's details if the name matched any name in the file. Here is my attempt [code] void update(EMPLOYEE *details) /*EMPLOYEE refers to strusture … | |
hello i am try to write a c compiler i have written a lexical analyzer code next is parser can i integrate it with some standard parsers what should be my next step can some one help me through | |
Hi, the following is the code for returning the position of a substring within a string(Brute force algorithm) [CODE] //Brute Force Algorithm #include<stdio.h> #include<string.h> int main(void) { char s1[20],s2[10]; int x1,x2,j,k,i; printf("Enter string 1:"); gets(s1); printf("Enter string 2:"); gets(s2); x1=strlen(s1); x2=strlen(s2); if(x1<x2) return 0; for(i=0;i<=x1-x2;i++) { j=i; k=0; while((s1[j]==s2[k])&&k<x2) { … |
The End.