15,539 Topics

Member Avatar for
Member Avatar for xaop

Hello, i have to create a program for- If the age is less than 18-You are still a kid 18-30 adult 30-60 middle age greater than 60-senior citizen else for any other impossible age (-ve or 0 age) ' wow ' Here is my attempt, [CODE]#include <stdio.h> #include <conio.h> void …

Member Avatar for abhimanipal
0
108
Member Avatar for noobuser

Hi, I want to solve a problem( to be honest its my homework ) given two string, the print the permutation in ordered form. Example: ‫‪Please enter the first string:> abc‬‬ ‫‪Please enter the second string:> mn‬‬ ‫‪Results will be: abcmn abmnc amnbc mnabc mabcn manbc mabnc ambnc ambcn abmcn‬‬ …

Member Avatar for abhimanipal
0
86
Member Avatar for speedy94519

I wrote a program that takes in this kind of input: [CODE]Short, Sue, , 3.11 Cisneros, Juan, G, 3.67 Andrew, T, 5.67 Superlonglastnamethatdoesnotfit, Betty, Boop, 2 Black, Shirley, T, 4.00[/CODE] and my program outputs this: [CODE]Highest gpa: 4.00 Average gpa: 3.19 Lowest gpa: 2.00 Sue Short 3.11 Juan G. Cisneros …

Member Avatar for nbaztec
0
114
Member Avatar for shereefatef

I have a text file with 500000 records , each record contain student ID and another index number. i insert this recors with separate function ,and i want when the user enter the student id the program get the corsponding index number and put it in avariable and use it …

Member Avatar for nbaztec
0
175
Member Avatar for xenanovich

hi, this is something i keep running into. for example, in the following example of strtok, i'm splitting a given string on a space(" ") delimiter: [code] #include<stdio.h> #include<string.h> int main() { char str[]="1234563 34 7898"; char delim[]=" "; char* result=NULL; char new[15][3]; int i=0; int j=0; bzero(new, sizeof new); …

Member Avatar for xenanovich
0
178
Member Avatar for cokaznsyco72

I'm writing this program where I have to dynamically allocate memory. So I created a function that mallocs space and does a few other things. When I try to manipulate later outside the function, I get a segfault. How do I make sure that space that I malloc inside of …

Member Avatar for Ancient Dragon
0
82
Member Avatar for HoldmysunnyD

Hello Daniweb, Could anyone please point me to an example implementation of a dynamic memory allocator that uses Segregated Fits with allocations from the front and insertions at the end? I've been trying to figure out a way to implement one, but I just don't know where to start.

Member Avatar for HoldmysunnyD
0
86
Member Avatar for chound
Member Avatar for schaden

Hi, So essentially I want to read every string in a file, then read every character in that string, find out if the string has two periods somewhere in it, and then save that string somewhere. Can someone get me started in the right direction?

Member Avatar for Narue
0
91
Member Avatar for n.cramp

Hi all, Im creating a virtual collections program at the moment, and have added a 'contextual information' panel which fades in on a button click, and then fades out when clicked a second time. Simple enough. Here's the code: [CODE] GLfloat alpha; BOOL Press[256]; GLuint GUIselect; BOOL objectInfo; BOOL scene; …

0
58
Member Avatar for james85

hi i would like u to tell me if i can make a random function to choose between four numbers and only them(-1 , 1 , -10 ,10)

Member Avatar for nbaztec
0
106
Member Avatar for MrDiaz

Hi everyone, I'm trying to accomplish the following; I need to create 2 subprocesses and each subprocess should create a process of their own. Should look like this: [QUOTE]I'm child xxxx parent xxxx I'm the subchild xxxx parent xxxx I'm the second child xxxx parent xxxx I'm the second subchild …

Member Avatar for MrDiaz
0
105
Member Avatar for farhanafzal

Write a C program to find and print the product of factorial of numbers from N to M. Can anyone please give me an idea, how to solve this Question ? Thank you.

Member Avatar for nbaztec
0
226
Member Avatar for RIsagara
Member Avatar for xenanovich

Hi, i am trying to read the contents of a text file containing a single line into a string. i'm doing this in a while loop. the text file gets updated in each run of the loop and therefore the string should contain a new value in each run. but …

Member Avatar for xenanovich
0
260
Member Avatar for Ferny84

Hey everyone, I'm trying to get this code to work... [CODE]#include <stdlib.h> #include <stdio.h> #include <stdbool.h> int allPrimes(int n) { int kiloN = n*1000; int count = 0; int i; for(i = 2; i <= kiloN; i++) { boolean hasfactor = false; int j = 2; while(j<i and !hasfactor) { …

Member Avatar for Aia
0
100
Member Avatar for didi00

Ok, guys I know that I'm asking too much questions, it's just that I really want to understand how things work. So I have a little project: Make a program in C which runs three processes (A,B,C), which use a common memory (buffer). Process A generates 50 random numbers and …

Member Avatar for didi00
0
677
Member Avatar for johndoe444

I was debugging a program and following is the snapshot: [CODE]81 while (j < len_y && suf_arr[j].word[0] == c) (gdb) 184 if (suf_arr[j].len > 1) (gdb) n 186 memcpy(temp_str, suf_arr[j].word+1, suf_arr[j].len-1); (gdb) n 187 ind = search(suf_arr, temp_str, len_y); (gdb) print suf_arr[j].word $13 = 0x7fffffff96d2 "bbit" (gdb) print suf_arr[j].word+1 $14 …

Member Avatar for UncleLeroy
0
2K
Member Avatar for saw77

[code]#include<stdio.h> #include<stdlib.h> main(){ char *tab; int n; int i; char c; printf("dimension du tableau?"); scanf("%d",&n); tab=(char*)malloc(n*sizeof(char)); printf("remplir le tableau :"); fflush(stdin); gets(tab); for(i=0;tab[i]!='\0';i++){ printf("%c",tab[i]); } }[/code] let's say i just want 5 letters in tab,so i run the program and put n=5,but what i don't get is that if i …

Member Avatar for saw77
0
209
Member Avatar for sdinu96

[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int a; char b[10]; char c; }; int main() { struct name *p; p = (struct name *)malloc(3 * sizeof(struct name)); char *n; n = "12345"; n = (char *)p; n = (int*)n; /*this is not correct . in doubt....change correctly*/ strcpy(n+(sizeof(p->a)),"ALL"); *(n+sizeof(p->a)+sizeof(p->b)) = …

Member Avatar for abhimanipal
0
109
Member Avatar for Don_k

The aim of the program is to add ten numbers then output their sum. I can do this but in a very basic way. for instance the only way I know how to do this is by adding each array and thats quite tedious and long is there any way …

Member Avatar for Aia
0
74
Member Avatar for Tellalca

I've been developing console applications using C/C++. I now want to move on and create some GUI applications. For that i saw some libraries to create GUI. I think those libraries are OS dependent. How can we create GUI applications compatible with Linux, Windows and Mac, or is it even …

Member Avatar for gerard4143
0
105
Member Avatar for sdinu96

{ int i = 25789; char *p; .............. .............. printf("%d",*p); /* (*p) should give in printf*/ } dont assign p=i ............apart from this how we can typecast this program so that we can get interger value tp pointer p.............please help me this

Member Avatar for Ancient Dragon
0
85
Member Avatar for happy101

i would like to know how i mean when i scan image how it is transfer to computer in basic .aslo can i know the code scan file or image.

-3
25
Member Avatar for didi00

Hi everyone! So can someone explain me how to compile a file with gcc? I'm using kubuntu, and I've written my source code in Kate(the text editor), and I saved it in documents like file1, and now how to compile it from the terminal? I've tried with the command: [code] …

Member Avatar for didi00
0
248
Member Avatar for Wizablue

I'm trying to make a program,it's almost done... but i'm stuck on an error message that I get. I would appreciate any help. The error message: [QUOTE]error: conflicting types for ‘findEntry’ note: previous implicit declaration of ‘findEntry’...LINE 15[/QUOTE] I get it for this code: [CODE] catalogPointer findEntry(catalogPointer head, char names[]) …

Member Avatar for Wizablue
0
357
Member Avatar for baby_c

hey guys i'm new to c and still learning.need some help here. i wrote this code and it isn't work properly,unable to figure out whats wrong!!but when the [B]strget()[/B] call from the main() its working.please some help... [CODE]main() { int x; printf("enter a value :"); scanf("%d",&x); switch(x) { case 1: …

Member Avatar for Aia
0
170
Member Avatar for saravanan.cse
Member Avatar for preethis
Member Avatar for absolutely
1
526
Member Avatar for sdinu96

[code]#include<stdio.h> #include<stdlib.h> #include<string.h> struct name { int *a; char b[10]; char c; }; int main() { struct name *p; p = ( struct name * ) malloc ( 3 * sizeof ( struct name ) ); char *n; n = ( char * ) p; *n = 275; strcpy ( …

Member Avatar for Banfa
0
374

The End.