15,551 Topics
| |
For the sake of readability, I've been trying to do something like this: [CODE]#define initialize(x)(type x = initfunction()) int main(){ initialize(example); example.item = 0; return 0; }[/CODE] where type is a typedef'd struct, and initfunction() generates one, inits values, and returns it. My problem is, I get these errors: warning: … | |
Here is a good listing of library functions. [url]http://www.cplusplus.com/reference/clibrary/cstring/[/url] | |
Hello, I am having some strings grammar problems. [CODE] char *eisodos1[50]; char e; int *a; int i; int main() { eisodos1[i]=getchar(); (1) e=eisodos1[i]; (2) if (eisodos1[i] == ' ') g++; (3) while ((e!=EOF) && (a!=EOF)); (4) } [/CODE] Please don't look the code like a complete program, I posted the … | |
hi friends , please explain loops and with example programe plzzz | |
have just "finished" learning C. By finished, I mean I have learned all the basics in plain vanilla C (command prompt style). I want to get into windows developement so that i can create something useful. What should be my next step? Should i be learning a object oriented language … | |
Hi guys, I badly need ur help.. well am nt zat gud in C programming. I've gt an assignment on a Video Club. To maintain 'its list of videos,the number of copies available for rental, the rental price, date on loan, the return date. Each video record should be represented … | |
I have the following code which basically acts as a typewriter: [code] int main () { char c; puts ("Enter text:"); do { c=getchar(); putchar (c); } while (!feof(stdin)); return 0; } [/code] However when I feed it a text file for input: [icode]$ ./typewriter < input.txt[/icode] it always adds … | |
Suppose if I have a dynArr pointer and a file pointer as parameters, and in the DynArr I am storing a TYPE with an integer value and a string description. How would I put the TYPEs in the DynArr into a txt file while tabbing between the string and the … | |
Hi I've been taking a python course and now that were done the professor wants us to write a program to list all the prime numbers from 2 - 10000. Oh yea and it has to be in C. So I am very stuck and really need help. Heres the … | |
Hello everybody, is there somebody that can help?? I'm having string (my example in string 55+22)that must be inputed by keyboard .. the first part I've done to put 55 to another array 2(with strtok function) Now that I was tries for many hours to put 22 to an other … | |
it prints the integer string b.var CORRECTLY.BUT not it's individual integer constants.....WHY? (ABCD.TXT is a bin text file containing data 10110000)[code]#include<stdio.h> #include<conio.h> #include<string.h> #include<stdlib.h> struct st { int var[8]; }; struct str2 { char a1; float a2; int a3; int a4; char a5; char a6; int a7; char a8; }; … | |
Hi, I'd like to copy one directory to another, including subdirectories. Each file that is copied over needs to have its own thread and each following thread must wait for the previous one to finish and exit before being created. The directory names are passed in *arg separated by a … | |
I am coding 2 dynamic arrays. basically ive done the first part which requires the user to enter rows and columns, i also implemented the functions to print and fill the created arrays. now the next task is to create a SINGLE dimensional array with enough size to fit the … | |
Why is it that in this statement "c = '\t'" is not "c == '\t'" (an additional equal sign). I read an explanation that it is because \t is a visual representation of the tab character. Isn't \n and ' ' also visual representations of a newline and space character … | |
| |
int c; c = getchar(); while ((c = getchar()) != EOF) putchar(c); c = getchar(); I know EOF means end of file. Basically, I believe this functions is instructed to keep inputing text from the keyboard until EOF becomes the subsequent input. However, I am not sure what EOF is … | |
This program here is supposed to count the number of occurrences blanks, tabs and newlines within the respective text you type within the program. However, after I compile the program and run it on ubuntu's terminal, all I am able to do is punch in text, space, enter etc... endlessly … | |
Quick question: what does "if(c == '\n') mean in this context? Is it just using '\n' as a reference for a numeric value within ASCII? which in that case would be 10, so if 10 is entered, this is when nl increments up one? { int c, nl; nl = … | |
As you'll notice this is an assignment from my computer science class, and if you look closely you'll also notice that this was due on march 3, so im not trying to get help for it. All this is for is to create some friendly competition and maybe keep the … | |
i'm having trouble creating a craps game for school, i'm a light weight c user and any help would be amazing!!! | |
Hi there, recently I wrote a small C program utilising the Windows API to communicate with a device over the serial port (COM1, a real serial port of my PC). This worked fine, but I am aware of the fact that those real COM ports are replaced more and more … | |
Hi there, On executing the above code I'm getting the error "segmentation fault". Is it possible to manipulate a string variable which already contains a data?[code]#include<stdio.h> int main() { char *str="Hello"; char * str1 ="World"; strcpy(str,str1); printf("%s",str); }[/code] | |
I can't seem to figure out the code you are missing. Any help getting the below code working would be great. [code]#include <stdio.h> #include <stdlib.h> #define SIZE 2 // initially to test kept it to SIZE 2 typedef struct { char firstName[30]; char lastName[30]; char street[35]; char city[20]; char state[3]; … | |
Have been programming in Turbo C for some time using an XP platform. I have recently bought a new computer also with XP and Turbo C programmes will not run on it. Has XP been modified recently? Is there any solution other than going back to 98? Thanks Cliff | |
Never use the function [inlinecode]gets[/inlinecode]. Why? It is unsafe. Since the maximum string size cannot be specified, it is always susceptible to buffer overflow. This snippet shows one way to do a safe version of [inlinecode]gets[/inlinecode]. It reads characters from the [inlinecode]stdin[/inlinecode] into a string up to the specified size … | |
| Hi i am doing C programming in netbeans and when i compile and run my program i get a message in the dos console that says i need to use the nodosfilewarning to disable the cygwin warning i am getting. I have attached a screenshot as it is a rather … |
ive seen this in code on different forums but i have no idea what it does, could someone explain this? | |
hi guys, I'm trying to implement a basic program which deals with structures and pointers. I have to insert data for various citizens, which is structure that have other structures as fields. in this case my main objective is to create 2 general functions that will get the information for … | |
Hi, please answer me the following questions. It will be very useful for me...Thanks in advance. c questions: 1. storage classes (auto, register, extern, static) in c with these informations (scope, lifetime, default value and memory location(where it stored in memory)). 2. why should we use static in function prototype … | |
Sir/Maam, please suggest me some very simple tutorials explaning right from the basics of such functions . I am doing C since 6 months and was looking at a tutorial of BEEJ's guide to network programming.. there at looking at a source code i found these functions and am really … |
The End.