19,876 Topics
![]() | |
Hi This code, compiles fine but results in a segmentation fault and when I comment out the part which adds the null character then the segmentation fault doesn't appear and it removes whitespace from the beginning but not the end. [code] #include <ctype.h> #include <string.h> #include <stdio.h> char *trim(char *s) … | |
I have a problem when I try to compile my code. Sorry in advance for non-english language in code.. npipe.c:78: warning: passing argument 1 of ‘sprintf’ makes pointer from integer without a cast /usr/include/stdio.h:361: note: expected ‘char * __restrict__’ but argument is of type ‘char’ npipe.c:80: warning: passing argument 2 … | |
hi guys! please help me understand anything about recursion and iteration ways of coding. :) (maybe some overview, details or something) thank u. we haven't had any further discussion about this. ;p but our teacher gave an exercise that goes like this: make a program that gets the summation of … | |
Hello. I have encountered a following problem "find all duplicate letters in a 2d char array and replace them with '@'" So for instance if I have this : a a b c The output would be @ @ b c So. I have come up with the following algorithm … | |
Hello everyone, i need help with using recursion in writing quite a simple code, but i'm kind of lost with recursion. The assignment is: When the user enters a certain amount of whole positive numbers and presses enter, the main function calls to the recursive separate functions that do the … | |
Hello this problem is from the beginner book C++ Primer Plus 5th edition.. The problem sounds something like this: Write a short program that asks for your height in feet and inches and your weight in pounds(Use three variables to store the information). Have the program report your body mass … | |
Hi to everyone! I have a problem with the following code. Can someone please point to me the error? #include <stdio.h> struct network{ char *name; }network1; int counter=0; main() { void add_network(); add_network(); printf("You typed: %s\n", network1.name); printf("counter is %d\n", counter); } void add_network() { char network_name[150]; puts("Give me the … | |
[CODE] ]void menu() { int option; printf("what would you like to do?"); printf("\n\t1. Create an Archive"); printf("\n\t2. extract an archive"); printf("\n\t3. Exit."); scanf("%d", &option); action( option ); } void action(int option) { int n1,n2; if (option == 1) { // how do i get from here to my code thats … | |
i convert some opengl code from visual c++ 2006 to visual c++ 2010 i mean visual studio framework. problem is in visual studio 10 they r running but mainloop is not working, i mean windows r supposed to wait for key input but it shows and gone at instant. no … | |
All right this is easy and for some reason im having trouble. Im workng on a Pig Latin program but right now all I want help with is getting an entire sentence to print out. I first tried to do this [PHP]char pig_latin() { char sentence[100]; printf("Enter a sentence\n"); scanf("%s", … | |
after my program finishes i get this message and dont why, can anyone explain *** glibc detected *** ./tryp: double free or corruption (top): 0x089b8008 *** ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(+0x6b591)[0xb7729591] /lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0xb772ade8] /lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0xb772decd] /lib/tls/i686/cmov/libc.so.6(fclose+0x14a)[0xb7719aaa] ./tryp[0x804875c] /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6)[0xb76d4bd6] ./tryp[0x8048521] ======= Memory map: ======== 08048000-08049000 r-xp 00000000 07:00 1725249 /home/k/cprog/tryp 08049000-0804a000 r--p 00000000 07:00 … | |
hey guys, i was wondering if you could help me with my problem! i made a program that uses 3 arguments as inline commands: argv[0] is the name of the program) argv [1] is the name of the first file argv[2] is the name of the second file The purpose … | |
can someone explain me what is the meaning of the number after the modulo (%) EX. printf("the number is: %10.2f", number); please help me define and understand the number after the % and give example, thanks! | |
Does anyone know how to insert something like this: [URL="http://www.google.com/imgres?imgurl=http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/XcodeWorkspace/art/code_completion_inline3.jpg&imgrefurl=http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/XcodeWorkspace/100-The_Text_Editor/text_editor.html&usg=__tzUerpkyaa1hAhy4AIx5q3ncRqE=&h=288&w=679&sz=48&hl=en&start=0&zoom=1&tbnid=YT_0hr0Qkfu4UM:&tbnh=80&tbnw=189&prev=/images%3Fq%3Dxcode%2Bcompletion%2Bbubble%26um%3D1%26hl%3Den%26client%3Dsafari%26rls%3Den%26biw%3D1190%26bih%3D944%26tbs%3Disch:1&um=1&itbs=1&iact=hc&vpx=493&vpy=109&dur=463&hovh=146&hovw=345&tx=175&ty=56&ei=dAz3TJfiM9GAswaK_t3jDQ&oei=dAz3TJfiM9GAswaK_t3jDQ&esq=1&page=1&ndsp=25&ved=1t:429,r:2,s:0"]http://www.google.com/imgres?imgurl=http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/XcodeWorkspace/art/code_completion_inline3.jpg&imgrefurl=http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/XcodeWorkspace/100-The_Text_Editor/text_editor.html&usg=__tzUerpkyaa1hAhy4AIx5q3ncRqE=&h=288&w=679&sz=48&hl=en&start=0&zoom=1&tbnid=YT_0hr0Qkfu4UM:&tbnh=80&tbnw=189&prev=/images%3Fq%3Dxcode%2Bcompletion%2Bbubble%26um%3D1%26hl%3Den%26client%3Dsafari%26rls%3Den%26biw%3D1190%26bih%3D944%26tbs%3Disch:1&um=1&itbs=1&iact=hc&vpx=493&vpy=109&dur=463&hovh=146&hovw=345&tx=175&ty=56&ei=dAz3TJfiM9GAswaK_t3jDQ&oei=dAz3TJfiM9GAswaK_t3jDQ&esq=1&page=1&ndsp=25&ved=1t:429,r:2,s:0[/URL] | |
[CODE] unsigned char buffer[1000] while(buffer < 0) num = fread(buffer,1, 1000, original_pointer); fwrite(buffer,1,num,copy_pointer); if(buffer > 1000) { //this is the place where i am stuck if the buffer exceeds how do i clear it then carry on reading and writing to a file ? [/CODE] | |
Hello every one! i want to create something like this (show at the bottom of this message as an attachment) but i've no clue how to create this digital payrmid. can anyone please help me with the code please? thanks for your help in advance cheers sh4rif | |
I am creating an abstract data type for strings implementing the string functions but not using the string library. I have my .c file and my .h file below. The problem seems to lie in addMystring I have commented out the area's that seem to have the problem. when they … | |
ok here is my project here so far: Main.cpp #include "Library.h" void main() { //GENERIC WECLOME SCREEN cout <<"\n\nWelcome to Hollow's Eye\n"; cout << "<Programmed by Ethan Rigel>\n"; cout << "Hollow's Eye a once bountiful and gorgeous land but alas; the\n"; cout << "Mighty Dragon has destroyed and ravaged our … | |
Functionality Read 2 numbers Print multiplication as in following example: 3333 1111 ---- ***3333 **3333 *3333 3333 ---- 3702963 Prepare following functions Modulo division (you cannot use '%') Mulitplication Print a number with leading and "following" spaces Please I need to do that in C language, I think the best … | |
its just a prank.. but shows the recatngle arrays and falling pixels in a 25 x 25 region snapshot of yur current screen after 10seconds... then creates a form and further cascades the pixels.. any key press will end it.. but its autostart will wait another 10 seconds and cascade … | |
Hi~ I've been stuck with this exercise for quite a few days. It's in a book I'm currently self-studying, C++ primer plus. The exercise requires using C syntax, while the exercise which follows this one requires using string objects instead, so i guess this is the appropriate forum^^. It is … | |
Functionality Read 2 numbers Print multiplication as in following example: 3333 1111 ---- ***3333 **3333 *3333 3333 ---- 3702963 Prepare following functions Modulo division (you cannot use '%') Mulitplication Print a number with leading and "following" spaces I have it: #include <cstdlib> #include <iostream> #include "conio.h" using namespace std; int … | |
Sorry but I'm having a problem whit this function that is meant to let me edit records in a binary file. After I enter what I want to change an attribute to the file remains unchanged. [CODE]void updateStudent(fstream & file) { S students; long lenth; char snum[10]; char editChoice = … | |
It counts upper lower and digits in a file .. | |
Hi, I'm kinda new to using MySQL,I just downloaded sqlite3 for my Linux. Can anyone give me some links to tutorials/sample codes that use MySQL and C as a programming language? Thank you | |
i wanna ask is that any statement can calculate number of occurrence of each letter (A-Z) instead of using switch statement or if statement to compare. | |
| |
Please give me a turbo c code on how to calculate grades with percentage. | |
so basically i wrote a progarm that begins with a menu allowing you to select one of 5 functions, but at the end of whichever function i would like it to return to the menu the problem is i dont know how to do that and would like any tips … | |
No error checking and other features, but a very basic .tar extracting snippet: [CODE]#include <stdio.h> #include <string.h> #include <stdlib.h> #include <sys/stat.h> struct tarheader { // for parsing the tar headers char name[100]; char mode[8]; char uid[8]; char gid[8]; char size[12]; char mtime[12]; char chksum[8]; char typeflag; char linkname[100]; char magic[8]; … | |
I am interested in being able to make a C++ win32 program that will simply display someones profile on a phpbb3 forum when they enter in their credentials. I've already made the GUI and other misc code needed for displaying the information, but I dont know how to make the … | |
![]() | hello again i got an assignment i thought i understand it but the every time i read it i understand it differently. my teacher won't explain the exercise. here is the exercise [IMG]http://img42.imageshack.us/img42/8331/37255827.png[/IMG] he also gave an input output example located here [url]http://rapidshare.com/files/434579925/sorted.zip[/url] i'v learned using shmat & shmget and … |
hello can any 1 hlp me for creating a secured exe file of an console application.means i hv created 1 program in c using dev c++ as compiler. now it is creating an exe file of the project in the same project directory. thats fine. nw along with that exe … ![]() | |
I wrote this function for an assignment. It utilizes dynamic memory, which grows and shrinks as needed. I wrote it like this at first: [CODE]int user_input (int * array, int intSize) { printf("Please enter any number of integers (80 characters per string max), enter an empty string to signal input … | |
Hi guys here is my code, prettty much the same as one posted before but im getting a few errors. Fairly new to this so if someone could help me out i would greatly appreciate it. Thanks in advance:) Here is the code and errors underneath that: #include<stdio.h> #include<string.h> #include<ctype.h> … | |
I need help with a program that is supposed to take data on football players from a txt file and place them in a binary search tree then use case statements to t osearch the tree inorder, preorder and postorder recursively here's what i got so far [CODE] /* Bradley … | |
Hello Guys! it's been a while. Lately, I've been wanting to study & explore C/C++ more. Because of this, I've done a lot of exercises that was given to us at school and some more around the net, but sadly the one that I'm really looking forward to the the … | |
i want to write a a program that will accept student name and grades and output it.use an array data structure in the implementation this program and implement the following write method that will traverses the array and allow the user to perform the following processes a) search for a … | |
im a student of 2nd year BS, doing my BS in Computer Science. Here I want to include a program by me, may be someone will be helped by me :) [code=c] #include<stdio.h> #include<conio.h> #include<stdlib.h> int* createHashTable(void); void getData(void); void formatting(void); int insertData(int); float chkLoadFactor(int, int); int collision_LinearProbing(int, int,int); int … | |
It is supposed to tell me the occurrences of letters both upper and lower case and digit and non letter nor digits characters ,,but it does nothing ,,please help as soon as possible #include<stdio.h> #include<ctype.h> #include<conio.h> int main(){ FILE *fp,*f2,*f3; char ch,temp; int i,j; int lowercase[26]={0}; int upperCase[26]={0}; int digits[10]={0}; … | |
Hi I'm having calculation error is the function - fraction::GCD(int& gcd, int e, int f) Example: If u enter 1/3 for both first and second fraction The unsimplified fraction would be 6/9 And when u call the GCD function and do the calculation by urself u can see that it's … | |
using dev c++ as compiler,bt coding the program in c.suppose i hv created 1 program in console application ,compiled it,run it, it works fine,on compiling & running it,. it produces the various supported assosciated with it. like makefile.win,gmon.out,project.exe,project.dev,main.o,main.c,now on seeing these files in notepad 1 can easily determined that program … | |
Hello, On the UNIX system that I am current working, to open a file in the pico editor ,I need to do the following: [CODE]>./pico filename.c [/CODE] Is there a script/command that I can execute which will remove the dot/slash and change that to: [CODE]> pico filename.c [/CODE] Thank you! | |
Hello Members, I have the following question about the pipe() system call. Say, Process A (my main()) forks a Process B which then forks a Process C. How can I open a pipe between Process C and Process A? I would like to write a sentence in Process C and … | |
hi! im also a beginner in using C im confused because ive got a problem. which the answer of C is different from mine here's my problem: !our teacher ask us to covert yards to meters, inches, feet. (my problem is the meter) feet = yard * 3 inches = … | |
Hi I'm new here and I have a problem which is hindering me. I have opened a file and wrote some stuff to it. Then later on I want to open the file and read it back in to a buffer. When I try to read the file back in … | |
I successfully configured MYSQL with VS2008, i executed the following code, and no errors were thrown. [CODE] #include <mysql.h> #include "stdafx.h" void main() { }[/CODE] Now i need to write a C++ code to retrieve some values from a Database, therefore i used the following code; [CODE] #include <mysql.h> #include … | |
[CODE]void user_input (int * array, int intSize) { printf("Please enter any number of strings (80 characters per string max), enter an empty string to signal input completion\n\n"); int i = 0; int j = 0; int arrayMax = MAXARRAY - 1; char input[81]; while (input[0] != '\0') { printf("->"); i … | |
Hello I am trying to read from a file. I'm followed a tutorial and had it working perfectly before, and it still does now.. But the problem is that one variable that I'm reading from the file is causing my program to crash. All the other vars I'm reading, are … | |
I have a CSV file with the following data 15278349,567892,3456,9742.30,CASH-WITHDRAWAL-200.00,DIRECT-DEBIT-200.00 64328975,632489,7562,98734.65,CHEQUE-DEPOSIT-100.00,CASH-DEPOSIT-424.54 etc... How would I print to screen the individual lines instead of just the top line?? Sam |
The End.