15,551 Topics

Member Avatar for
Member Avatar for Aterin

Greetings, I need to develop an application which allows tree main features: to search a text file line by line and if it finds the text then it prints the whole line, so for example lets say the text file has: abcd efgh and i would run the applications with …

Member Avatar for Aterin
0
285
Member Avatar for saamsonn

#include<stdio.h> int strlen_(const char *string); int strlen_(const char *string) { int length; for(length = 0; *string != '\0'; string++){ length++; } return length; } char *strcat_(char *string1, const char *string2); char *strcat_(char *string1, const char *string2) { char *p = string1; if(string1 == NULL || string2 == NULL) return string1; …

Member Avatar for Ancient Dragon
0
184
Member Avatar for Ninetie

Let's say we have the two strings FOOBAR and BFORAO. While not really equal as strings, they contain exactly the same characters and according to my needs, I can treat them as equal. And I will be calling them "equal" from now on to avoid typing again and again long …

Member Avatar for Ancient Dragon
0
4K
Member Avatar for Gazzmonkey

Hi, only posting here as a last resort since I cannot find anything at all online to help me with my project. Anyways, I'm developing an autonomous mobile robot with colour tracking using a khepera II as my robot and a CMUcam2 turret module as my onboard camera, I had …

Member Avatar for Gazzmonkey
0
193
Member Avatar for Hitman Mania

Hey, I have this simple lab that I'm working on, but I keep getting an error while compiling. Here's the question: **Write a program called lab09.c that -prompts the user for a character and then a string. -REMOVES all occurrences of that character from the string, and -prints the changed …

Member Avatar for jayarajtk
0
263
Member Avatar for hwoarang69

never help with pointer and functions. i want to creat a function what check if "char *test" is inside "char array[1]" int main() { char array[1] = {"one", "two"}; char *test = "one"; check(test, array); } void check(char test, char array[]) { int i; for(i = 0; i <= 1; …

Member Avatar for jayarajtk
0
120
Member Avatar for tubby123

A lot of people tell me that my code results in Memory Leaks. Since, I am still in an academic environment, it has not had any drastic result on any projects, but I still want to correct it. I have posted below some C code, please go through the coding …

Member Avatar for michelleradu
0
158
Member Avatar for swissknife007

I am working on a project with my friend where we have to update existing version of a game which uses SDL 1.2 to use SDL 2.0 header files and functions. I would like to know what is the standard procedure we follow while updating already existing source code to …

Member Avatar for Ancient Dragon
0
162
Member Avatar for cali_kid

**I am trying to write a program that will pring a list of random numbers from 1-100 and store them in an array. and then bubblesort them into ascending order. This is what i have so far but it is giving me a whole different set of ascending numbers after …

Member Avatar for zeroliken
0
180
Member Avatar for tabbyheart

We just read about Functions and Arrays, and I'm still a little confused on those as well as passing a function by reference and calling it. I've been trying to get help from my online teacher, but he's not entirely helpful on the things that I don't completely understand, and …

Member Avatar for deceptikon
0
163
Member Avatar for robgeek

Hello everyone, This is my first program in C and I have ran into weird issue. I am implementing a simple server & client program in C. From my main() in client I call a send_message() function which I believe binds with server and sends the message to the server …

Member Avatar for WaltP
0
196
Member Avatar for osiron

Hi everyone, I'm working on an assignment that takes a record of student ID, student last and first name and their score, using array of pointers, qsort to sort in alphabetical order, typedef structs, malloc and calloc, etc. and the program prompts those records and it is stored in dynamic …

Member Avatar for osiron
0
185
Member Avatar for niyasc

Now I'm learning basics of gtk using C. In gtk the declaration of a text box is as follows GtkWidget *gtk_text_new( GtkAdjustment *hadj, GtkAdjustment *vadj ); Here can anyone tell me what is the meaning of hadj and vadj? I mean what type of value we should pass?

Member Avatar for WaltP
0
88
Member Avatar for hwoarang69

FILE *finp1 = file.txt -------------- web: add $1,$2,$3 sub $4,$5,$6 end: .word 5 ------------------ for some reason i can not go in my 2nd if statment. i think bc i am not using strtok right ------------------------------------------------code---------------- while(fgets(line, 20, finp1) != NULL) //works { tptr = strtok(line, ":"); //works if(tptr != …

Member Avatar for Banfa
0
89
Member Avatar for Gaiety

Hi, I have added sleep with random timings and printed the values. I am actually expecting the "Blocked in Child" OR "Blocked in Parent" out put when other process sleeps. But it it never printing the statement.(when the process is going to sleep the semaphore is not cleared so i …

Member Avatar for Banfa
0
128
Member Avatar for hwoarang69

lets say i there is a file with 2 lines in it. and we going to read from it. only thing we dont how how many spaces there are. for ex " -hello ", " -hello", "-hello", " -hello " file.txt ----------- -hello -hello 29 ----------- i want to skip …

Member Avatar for Ancient Dragon
0
137
Member Avatar for Best in world

Hi, I was working with Luminary lm3s811 board with Stellaris Keil. Initially it worked well..sometime later i tried to run program by changing crystal value which is normally taken as 6Mhz.. When i changed it to 6Mhz/2..it worked..but when i went for 6Mhz/12..something went wrong.. Now i can not program …

0
42
Member Avatar for hwoarang69

for some reason it always return 1; lets say char line will have a empty line or not empty line. int main(void) { char line[20]; //user may enter some word or enter nothing in LINE if(empty_line(line) != 0) { //... } } int empty_line(char line[]) { for(i = 0; i …

Member Avatar for Ancient Dragon
0
80
Member Avatar for Oracle1986

Hey all, Im working on a number guessing game where a user has 10 tries to a guess a number. The program supposed to display user guesses and then the main menu after the game has finished. Im running into a couple of problems. The first one being that for …

Member Avatar for Oracle1986
0
250
Member Avatar for 9tontruck

Hi, I am making an image editing program with C and it will come with OpenCV library files. The problem is the program should be accessible from many different operating systems such as Windows, MacOS, IOS, Android - the point is that we want to avoid re-write same code in …

0
55
Member Avatar for 9tontruck

C programming in IOS? Hi, I am implementing an image editing program in C which should work both in Windows, IOS (iDevices). Ths point is that we do not want to re-write same code in Object-C or Xcode. Let's say that we have a C program that is just resizing …

Member Avatar for 9tontruck
0
287
Member Avatar for brandon93s

I am writing a program in C to build linked lists from scratch. However, I am getting hung-up on trying to build a link list that will automatically sort itself. By this, I mean that the nodes will automatically be placed in the correct location. My current code is putting …

Member Avatar for histrungalot
0
583
Member Avatar for coder_10

I am trying to read a file from an offset till end of file: int i,sizeb=210; char *buffer; //[1024]; FILE *f; f = fopen("myfile", "rb"); printf("Reading file.\n"); fseek(f, sizeb, SEEK_SET); long s = ftell(f); //rewind(f); fread(buffer, s, 1, f); fclose(f); But I never get the right result. Also when I …

Member Avatar for coder_10
0
2K
Member Avatar for colow3481

Hello, I am looking for a code to ask the user to input a string int a function. And explication on what does what. I'll be taking a computer science class next year and I try to do some understand some basics. Thank You for your time.

Member Avatar for zeroliken
0
123
Member Avatar for selin4

int main() { FILE *dp; char name[15]; char sname[15]; int no; char department[10]; char sex[3]; char city[15]; int age; int phone; int num; dp=fopen("veri.dat","r"); if(dp==NULL) { printf("file couldnt opened\n"); return 1; } printf("enter student number:\n"); scanf("%d",&num); while(!feof(dp)) { fscanf(dp,"%d",&no); if(no==num) { printf("%s%s%d%s%s%s%d%d",name,sname,no,department,sex,city,age,phone); } } fclose(dp); system("pause"); return 0; } I …

Member Avatar for zeroliken
0
94
Member Avatar for hwoarang69

i want to create array of pointer. "aa" "ab" "ac" i tried many thing but it still give me error. char *table[3] = "aa", "ab", "ac"; or char *table[3]; *table[0] = "aa"; *table[1] = "ab"; *table[2] = "ac";

Member Avatar for hwoarang69
0
167
Member Avatar for xEffrego

My code is this atm: #include <stdlib.h> #include <stdio.h> int main(int argc, char *argv[]){ int a,b,c; int swap; printf("Enter 3 Numbers (# # #):"); scanf("%d %d %d", &a,&b,&c); //does all its computing, to see which one is biggest. return EXIT_SUCCESS; } The result when i run it in eclipse is …

Member Avatar for WaltP
0
2K
Member Avatar for shean1488

Hi everybody, When I tryed to compile a C program, compiler gave me error, that I haven't see before. Please tell me what does it mean? and what are the possible reasons, this error occure. blade71(20)% gcc lineholder.c -o lineholder Undefined first referenced symbol in file main /tools/gcc/bin/../lib/gcc/sparc-sun-solaris2.8/3.4.2/crt1.o ld: fatal: …

Member Avatar for shean1488
0
341
Member Avatar for yamigx

Hi all.. I wrote a program for this: A C program can represent a real polynomial p(x) of degree n as an array of the real coefficients a_0,a_1,…a_n (a_n≠0). 〖p(x)=a_0+a_1 x+a_2 x〗^2+⋯+a_n x^n Write a program that inputs a polynomial of maximum degree 8 and then evaluates the polynomial at …

Member Avatar for zeroliken
0
408
Member Avatar for Esmerelda

Is there a difference between keywords and reserved words? Is main() a reserved word?

Member Avatar for thines01
0
135

The End.